Defined Free Memory and GC Using JSR 308

Suminda Dharmasena sirinath at
Fri May 3 08:31:09 UTC 2013


Java can eliminate much of its reliance on GC using annotations for GC.

Many local objects can be collected without GC using C++ style delete by
the compiler (transparent to user) if it does not escape current context.
If the containing / aggregated objects live longer then these need GC. Also
if the object out lives the current context. To ensure the GC timing and
loads are know I have beeing thingking it will be a good idea
to introduce annotations.

Possible annotation:
GCAtBlockExit - for loops the GC happens when the
GCOnGCOfContainingObject - GC on GC of aggregate / composing object
GCOnStatementCompletion - GC parameters and return value (if not assigned)
of a call when the function returns. Need to support statement level
GCOnLastResort - Only GC at last resort before outofmemory exception -
class level
ExcludeFinalising - prevent finalizers running on the object - class level
GCUsingNewThread(Priority = n)
GCUsing(GCSystem) - all objects created in the specified scope will be GCed
using specified GC - annotations need to support static references
GCSuspend - a synchronous object can be used so that the GC threads do not
run while the code block is executing

Suminda Sirinath Salpitikorala Dharmasena, B.Sc. Comp. & I.S. (Hon.) Lond.,
P.G.Dip. Ind. Maths. J'Pura, MIEEE, MACM, CEO Sakrīō! ▣ *Address*: 6G • 1st
Lane • Pagoda Road • Nugegoda 10250 • Sri Lanka. ▣ *Mobile*
: +94-(0)711007945 ▣ *Tele*: +94-(0)11-5 864614 / 5 875614 / 2 825908 ▣ *Web
*: ▣

This email is subjected to the email Terms of Use and Disclaimer: Please read this first.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the hotspot-gc-dev mailing list