javax GC API
Suminda Dharmasena
sirinath at sakrio.com
Sat Apr 20 03:33:37 UTC 2013
Hi,
Many objects created locally and final static /
constructor initialized composition objects in the locally created object
can be allocated in the stack thus with proper compile time escape analysis
in a language like java which does not have pointer aliasing can eliminate
the need of a GC for about 90 % of the cases.
Introducing these semantics will ensure this as current java model defaults
to heap allocation. Also giving control at what point to adjust the stack
frame thus the memory allocated to the objects are claimed. This will
increase Java's appeal for small memory embedded RT systems as GC will
become the last resort fall back and many objects will not need to be GCed.
IMO, the runtime overhead of complicated GC mechanisms are not warranted as
the objects that really needed to be allocated on the heap are static
fields and fields that not final and cannot be declared final. Many fixed
size non final objects also can be stack allocated. When they get updated
the object needs to be replaced in the relevant stack frame. Also analysis
could check if an object that escapes the current stack frame makes its way
to a parent stack frame. This way provisions can be made to allocate in the
parent frame.
Also many of the stack allocated objects need not be finalised unless the
object's finalizer method is overridden. This will reduce memory reclaim
overhead.
With regard to heap allocated objects the GC can also happen at defined
intervals. E.g. if an object is marked GCOnReturn if the return object is
not utilised after return it is GCed. Also GCOnBlockExit will ensure all
objects in a loop be GCed.
Suminda
--
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. ▣ *Tele*: +94-(0)11-5
864614 / 5 875614 / 2 825908 ▣ *Web*: http://www.sakrio.com ▣
This email is subjected to the email Terms of Use and Disclaimer:
http://www.sakrio.com/email-legal. Please read this first.
--
On 20 April 2013 00:23, Bernd Eckenfels <bernd-2013 at eckenfels.net> wrote:
> [image: Boxbe] <https://www.boxbe.com/overview> Bernd Eckenfels (
> bernd-2013 at eckenfels.net) is not on your Guest List<https://www.boxbe.com/approved-list?tc_serial=13987150962&tc_rand=1830316824&utm_source=stf&utm_medium=email&utm_campaign=ANNO_MWTP&utm_content=001&token=ERETQw2iSwWyZqUVy76d2X7D%2F%2F1UN2fq1vBQ3U05A610e9%2BPq6fzfA1%2BIWsiZ6IC&key=tCvAXRTXiRsJgeiodBg7x4xQ4kT9uFWND969c4eXeK8%3D>| Approve
> sender<https://www.boxbe.com/anno?tc_serial=13987150962&tc_rand=1830316824&utm_source=stf&utm_medium=email&utm_campaign=ANNO_MWTP&utm_content=001&token=ERETQw2iSwWyZqUVy76d2X7D%2F%2F1UN2fq1vBQ3U05A610e9%2BPq6fzfA1%2BIWsiZ6IC&key=tCvAXRTXiRsJgeiodBg7x4xQ4kT9uFWND969c4eXeK8%3D>| Approve
> domain<https://www.boxbe.com/anno?tc_serial=13987150962&tc_rand=1830316824&utm_source=stf&utm_medium=email&utm_campaign=ANNO_MWTP&utm_content=001&dom&token=ERETQw2iSwWyZqUVy76d2X7D%2F%2F1UN2fq1vBQ3U05A610e9%2BPq6fzfA1%2BIWsiZ6IC&key=tCvAXRTXiRsJgeiodBg7x4xQ4kT9uFWND969c4eXeK8%3D>
>
> Am 19.04.2013, 10:06 Uhr, schrieb Suminda Dharmasena <sirinath at sakrio.com
> >:
>
>> - GCAtBlockEnd
>> - GCAtBlockExit - for loops the GC happens when the
>> - GCAtLastReference
>> - GCAtEndOfScope
>> - GCOnAssignment
>> - GCOnReturn
>>
> ...
>
>> At each point the objects pointed by the handle are GCed if there is
>> a possibility (reference count becomes 0). If a reference to an object is
>> specified to be
>>
>
> I think most of those annotations are not possible with modern GCs. You
> need to be aware that there is no reference counting and there is already
> Escape Analysis, Nursery and Thread Local allocations dealing with most of
> the scopes you listed above anyway.
>
> Greetings
> Bernd
> --
> http://bernd.eckenfels.net
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20130420/fffc3e58/attachment.htm>
More information about the hotspot-gc-dev
mailing list