ParallelGC does not allocate all memory it could have
Jon Masamitsu
jon.masamitsu at oracle.com
Tue May 8 21:24:59 PDT 2012
Emanuel,
Run you test with -XX:+PrintGCDetails and -XX:+PrintHeapAtGC and
send the output for at least the last half dozen GC's. Also, have you
test program print out the size of the allocation that failed with the
OutOfMemory and send that.
Jon
On 5/8/2012 5:32 PM, Emanuel Couto wrote:
> Hi,
>
> I have a question regarding ParallelGC. I have used the following
> parameters to execute a program that is creating objects of random
> size until no more heap is available:
>
> java -XX:+UseParallelGC -XX:+UseParallelOldGC -Xmx256m -jar<MyJar> <parameters>
>
> I noticed that when it is not possible to allocate more memory in the
> tenured generation and it is full, the JVM does not allocate the
> maximum possible memory for the young generation, thus throwing an
> OutOfMemoryException before the heap is full.
>
> When the OutOfMemoryException is thrown the tenured generation
> allocates 170MB, which is maximum size according to visualvm. The
> young generation only allocates 20MB, but it had 85MB reserved.
>
> This behavior does not happen with SerialGC or ConcurrentGC.
>
More information about the hotspot-gc-use
mailing list