[G1] Why humongous object bytes allocated after a collection are not recorded in G1Policy::_bytes_allocated_in_old_since_last_gc?

Thomas Schatzl thomas.schatzl at oracle.com
Mon May 25 08:41:02 UTC 2020


On 23.05.20 00:30, Luo, Ziyi wrote:
> Hi,
> I have a question about humongous object allocation result in g1CollectedHeap:
> http://hg.openjdk.java.net/jdk/jdk/file/6d7c3a8bfab6/src/hotspot/share/gc/g1/g1CollectedHeap.cpp#l874
> http://hg.openjdk.java.net/jdk/jdk/file/6d7c3a8bfab6/src/hotspot/share/gc/g1/g1CollectedHeap.cpp#l893
> L874 returns the result after a successful humongous allocation. L893 returns
> the result after a successful G1CollectForAllocation. In the former case, the
> allocated bytes are recorded in
> G1Policy::_bytes_allocated_in_old_since_last_gc in L873. But bytes in the
> latter case are not. Is this intentional or a mistake?
> Best,
> Ziyi

   the collection itself has some code to add the allocated bytes. In 
the first case since there is no collection, that value needs to be 
incremented manually.

But you probably already know that, you filed JDK-8245511 :)


More information about the hotspot-gc-dev mailing list