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.

cheers

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to