Re: [rvm-research] Jikes Code Cache Management
Eliot Moss <[email protected]>
| Newsgroups | gmane.comp.java.jikes.rvm.devel |
|---|---|
| Message-ID | <[email protected]> |
On 5/7/2013 1:39 PM, Pushparaj Motamari wrote: > I need help regarding Good resources to start understanding the Code Cache Management in JikesRVM? Dear Pushparaj -- AFAIK it is not something I would actually call a cache. Code gets generated for some methods as part of the system build process (namely for those methods needed by the system itself). When the system is about to run a method that has not yet been compiled, then the method will be compiled. The default policy will use the "baseline" (non-optimizing) compiler. There are various controls that can override the policy. If a method is seen to be executed frequently enough, it will be re-compiled with the optimizing compiler -- sometimes multiple times (at increasing levels of optimization). Future calls go to the latest version, and it is even possible to redirect calls *currently in progress* to new code using a technique called On Stack Replacement (OSR). If you want to grasp that, I recommend reading the conference paper about it. Anyway, as newer version are compiled, older ones fall into disuse, but AFAIK the space is not reclaimed. Compiled code resides in a space separate from the main garbage collected heap, and is never moved by the GC, which means that references to code, or positions within code (e.g., return addresses) do not have to be updated. (If I am wrong about the space being reclaimed, then clearly it is managed by a mark-sweep / free-list kind of technique.) So, is the space management you wanted to know about, really, or the recompilation policies? Regards -- Eliot Moss ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may