On Wed, 26 Aug 2026 15:54:53 GMT, Aleksey Shipilev <[email protected]> wrote:

>> Please review this simple change to remove filler arrays (and objects) from 
>> heap dumps. In the hprof format, they are not distinguishable from `int[]`, 
>> which can be confusing (where are these huge `int[]`s coming from in my 
>> application?), and they bloat the heap dump time and size.
>> 
>> (Note: I sent a request for comments [on the serviceability-dev mailing 
>> list](https://mail.openjdk.org/archives/list/[email protected]/thread/USL6YYR2UW76Z4VFESN225ZASLL2DHYQ/)
>>  but got no response, so made a PR)
>> 
>> Using Eclipse MAT, before:
>> 
>> with-filler.hprof - 6.2GB
>> 
>> Class Name | Objects | Shallow Heap
>> =====================================
>>     byte[]    39,938   4,997,553,360
>>      int[]    45,839   1,140,524,000
>> 
>> 
>> After:
>> 
>> without-filler.hprof - 5.0GB
>> 
>> Class Name | Objects | Shallow Heap
>> =====================================
>>     byte[]    48,321    4,998,520,248
>>      int[]     4,995          951,088
>> 
>> 
>> ([Test 
>> file](https://gist.github.com/olivergillespie/1661499afb9e1c708de30cf0bdfca30e))
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> src/hotspot/share/services/heapDumper.cpp line 2206:
> 
>> 2204:   }
>> 2205: 
>> 2206:   if (CollectedHeap::is_filler_object(o)) {
> 
> OK, so `mark_dormant_archived_object` filters objects with classes which Java 
> mirrors have not yet loaded. But for filler objects, I expect 
> `Universe::fillerArrayKlass()` and `vmClasses::FillerObject_klass()` to be 
> fully loaded at all times. So we can filter filler objects ignoring the 
> dormant class check. Could be marginally cheaper if we have lots of filler 
> objects.
> 
> But also, it is likely a very thin papercut; so I do not insist.

Thanks. I can move it above.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32542#discussion_r3864856239

Reply via email to