G1gc compaction algorithm
Martin Makundi
martin.makundi at koodaripalvelut.com
Wed Jul 16 06:27:43 UTC 2014
Hi!
The size of humongous objects varies, 1M up to 50M I have seen from logs, I
assume they are EhCache objects because they are not direct allocations (we
have a memory allocation logger which does not see any of these allocations
as simple byte array allocations). Our region size is 5M seems to trigger
lowish level of full gcs (only a couple pre day, which is still too much
ofcourse, we would prefer zero).
What about compacting the small bits, does g1 compact the scattered bits
(gather small chunks from all over the memory to the first region, for
example) to allow more humongous ones?
**
Martin
2014-07-16 8:29 GMT+03:00 Yu Zhang <yu.zhang at oracle.com>:
> Martin,
>
> Humongous objects are treated specially. They are not collected in young
> gc.
>
> By definition, if the object size > 1/2 region size, it is humongous
> object. If the object size is just a little over 1/2 region size, then the
> fragmentation could be high.
>
> One trick we can do is to increase region size (-XX:G1HeapRegionSize) so
> that we do not see much humongous allocation. Do you know the size of the
> humongous objects? If you use -XX:+PrintAdaptiveSizePolicy, you can see
> that information.
>
> The humongous objects are handled better in latest jdk8, and more
> improvement under development.
>
> Thanks,
> Jenny
>
> On 7/15/2014 8:45 PM, Martin Makundi wrote:
>
> Hi!
>
> Humongous allocation fails when there is not enough contiguous free
> space in memory.
>
> How does g1gc compaction algorithm work, does it compact only within a
> region or does it attempt to compact in a whole-heap-defragmentation way?
> The latter would reduce the probability of "humongous allocation failure".
> And if this is possible, is there a parameter/s that can be changed to tune
> this?
>
> **
> Martin
>
>
> _______________________________________________
> hotspot-gc-use mailing listhotspot-gc-use at openjdk.java.nethttp://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20140716/8c39e5ec/attachment.html>
More information about the hotspot-gc-use
mailing list