JDK Memory Allocation

JC Beyler jcbeyler at google.com
Thu Aug 2 02:49:48 UTC 2018


Allocations will happen in various forms:
  - In the TLAB directly (if enabled)
  - Outside of the TLAB for various reasons (allocation too big, allocation
too big to fit in what remains in the TLAB and we don't want to waste space
from the remaining TLAB)
  - Eden space
  - etc.

The best way is to trace it and see what happens,
Jc


On Wed, Aug 1, 2018 at 5:51 PM mr rupplin <mearvk at outlook.com> wrote:

> David.
>
> Thanks.  Seems that you're right.
>
> In the JDK9 stack they seem to have struck onto a different formula.  Let
> us know if you have that one too or also.
>
> Kthxbye,
>
> Mr. Rupplin
>
> /sr software developer
> ------------------------------
> *From:* David Buck <david.buck at oracle.com>
> *Sent:* Saturday, July 21, 2018 9:10 PM
> *To:* mr rupplin
> *Cc:* hotspot-gc-dev at openjdk.java.net
> *Subject:* Re: JDK Memory Allocation
>
> Hi Max!
>
> Your question does not seem to be related to building OpenJDK, so I have
> BCCed build-dev from the thread and added gc-dev. That said, I am not
> sure any of the development lists are really an ideal place to ask
> general "code walk through" questions.
>
> If really necessary, memAllocator.cpp [0] would probably be as good a
> place as any to start reading the source code. But unless you intend to
> hack on the JVM itself, trying to read this source code may not be the
> most productive use of your time. You may get a lot more out of reading
> some of the wikis [1], blogs [2], and books [3][4] that cover the
> HotSpot JVM in detail. Even if you ultimately chose to read the source
> code directly, reading these other types of resources first should
> really help you make better sense of what you see in the source code.
>
> Cheers,
> -Buck
>
> [0]
>
> http://hg.openjdk.java.net/jdk/jdk/file/b0fcf59be391/src/hotspot/share/gc/shared/memAllocator.cpp
> [1] https://wiki.openjdk.java.net/display/HotSpot/Main
> [2] https://shipilev.net/jvm-anatomy-park/
> [3] https://www.goodreads.com/book/show/13227108-java-performance
> [4]
> https://www.goodreads.com/book/show/23316035-java-performance-companion
>
> On 2018/07/22 8:51, mr rupplin wrote:
> > Having looked for some while at the OpenJDK source code I am unable to
> find where the memory allocation occurs.  I will be working very much with
> the JDK and would like to get a firm grasp on its underlying mechanisms.
> >
> > public class JustAsk
> > {
> >       public static void main(String...args)
> >       {
> >           for(int i=0; i<100; i++)
> >           {
> >              new JustAsk();
> >           }
> >       }
> > }
> >
> > This doesn't seem to rely on any of the functions in the libjli nor of
> the jni.h.  So clearly where do we look for the handler here?
> >
> > Thanks,
> >
> > Your friend Max
> >
>


-- 

Thanks,
Jc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20180801/9912cdfe/attachment.htm>


More information about the hotspot-gc-dev mailing list