On Thu, 17 Sep 2026 08:41:04 GMT, Oli Gillespie <[email protected]> wrote:

>> Heap dumps offer the ability to exclude unreachable objects, but they 
>> actually still include GC filler objects/arrays (see 
>> https://tschatzl.github.io/2022/09/26/jdk-vm-internal-fillerarray.html for 
>> more on fillers).
>> 
>> If the user requests to exclude unreachable objects/include only live 
>> objects, heap dump triggers a full GC before dumping, so in theory only live 
>> objects remain. But filler objects can 'survive' a full GC even though they 
>> are unreachable by definition. They waste space, and cause confusion. If 
>> using a tool like MAT, they will show as unreachable - why are unreachable 
>> objects in my live heap dump? If using something like JOL to show a 
>> histogram, reachability is not assessed and the user may not notice that 
>> unreachable objects are influencing the results. They show as `int[]`, so 
>> their provenance is not obvious.
>> 
>> So, exclude them explicitly if the user requested only live objects. This 
>> does not affect non-live dumps (discussion for that in  
>> [JDK-8372389](https://bugs.openjdk.org/browse/JDK-8372389)).
>> 
>> 
>> $ ls -lah
>> 1.5G Sep 14 13:30 live-after-fix.hprof
>> 2.6G Sep 14 13:30 live-before-fix.hprof
>> 
>> $ java -jar jol-cli.jar heapdump-stats live-before-fix.hprof
>> 
>>        INSTANCES            SIZE        SUM SIZE    CLASS
>> ------------------------------------------------------------------------------------------------
>>                5     236,870,896   1,184,354,480    int[59217720]  <--- 
>> filler arrays!
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Oli Gillespie has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Revert "Rename skip_filler_objects -> should_skip_filler"
>    
>    This reverts commit ad572794d548c2d6154d80640d01f14b1941a4e8.
>  - Rename skip_filler_objects -> should_skip_filler

Thanks for reviews

-------------

PR Comment: https://git.openjdk.org/jdk/pull/32860#issuecomment-5717246795

Reply via email to