harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Garner <robin.gar...@anu.edu.au>
Subject Re: [General VM] GC strategy:how to garbage collect short-lived objects quickly.
Date Tue, 19 Sep 2006 07:22:11 GMT
Egor Pasko wrote:
> On the 0x1E4 day of Apache Harmony Alexey Varlamov wrote:
>> Just a wild idea: a smart JIT could hint a GC during allocation if an
>> object is expected to be short-lived so the GC could allocate it in a
>> special space, 
> if a JIT can prove that the object is local, it can allocate it on
> stack almost without help of VM. An imprecise estimation of
> short-liveness is a kind of magic. What heuristics can we use? Small
> objects live shortly? :)

Stack allocation generally performs more poorly than heap allocation.

In fact the cheapest place to allocate a short-lived object is in the 
nursery where all objects are allocated - the cost of allocation is 
simply incrementing a counter and doing a bounds check.

Identifying objects (usually call sites) that are likely to live for a 
long time, and allocating them directly into the mature space is called 
pre-tenuring, and there has been a lot of work done on that.

ALl this can be done by the JIT at run-time, although feedback from the 
VM via sampling can be useful.


Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message