History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-2807
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Charles Oliver Nutter
Reporter: Charles Oliver Nutter
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

Migrate inheritance-based cache compiler to use arrays for more stuff

Created: 16/Jul/08 02:32 AM   Updated: 16/Jul/08 02:32 AM
Component/s: Compiler
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
The current caching logic in the compiler leans on the fact that the superclass of a Script, AbstractScript, defines a bunch of fields to use for caching fixnums, symbols, regexps, blocks, and so on. Unfortunately this also wastes memory for ever Script instance instantiated, since regardless of whether they need 50 call site caching slots, they'll take up 4 bytes each in the object. So that's 200 bytes for call site references, 200 bytes for symbol references, and 200 bytes for fixnum references; 600 bytes of memory per instantiated Script (including jitted methods, even the tiniest ones) that might never be filled or used.

The inherited cache logic was originally added to reduce the amount of permgen taken up by all those generated classes, since defining new fields adds new metadata which eats up permgen memory on at least HotSpot. But it seems this move may have traded some amount of permgen for more heap memory, and we could certainly do better to reduce them.

It would be interesting to see what the actual in-memory size of Script subclasses is and whether this inefficiency has a real impact on heap usage. At any rate, it ought to be addressed.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.