On Sat, 28 Mar 2026 00:53:41 GMT, Chris Plummer <[email protected]> wrote:

>> Although SA has some FlatArrayKlass support, it is mostly incomplete. This 
>> is causing heap walking to abort when a flattened array of value objects is 
>> encountered. 4 SA tests are failing in non-obvious ways because of this.
>> 
>> [JDK-8380769](https://bugs.openjdk.org/browse/JDK-8380769) [lworld] 
>> resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java fails with 
>> 'truncating to' missing from stdout/stderr with --enable-preview
>> [JDK-8380851](https://bugs.openjdk.org/browse/JDK-8380851) [lworld] 
>> serviceability/sa/ClhsdbJstackWithConcurrentLock.java fails with "', (a 
>> java/util/concurrent/locks/ReentrantLock$NonfairSync)' not found in jstack 
>> output" when using --enable-preview
>> [JDK-8380852](https://bugs.openjdk.org/browse/JDK-8380852) [lworld] 
>> serviceability/sa/CDSJMapClstats.java fails with "'BootClassLoader' missing 
>> from stdout/stderr" with "-XX:-UseCompressedOops --enable-preview"
>> [JDK-8380853](https://bugs.openjdk.org/browse/JDK-8380853) [lworld] 
>> serviceability/sa/ClhsdbJhisto.java fails with "'java.nio.HeapByteBuffer' 
>> missing from stdout/stderr" with "-XX:-UseCompressedOops --enable-preview"
>> 
>> The main shortcoming is that there is no FlatArray type in SA yet, and also 
>> the code to instantiate it is missing in the following:
>> 
>> 
>>   public Oop newOop(OopHandle handle) {
>> ...
>>     Klass klass = Oop.getKlassForOopHandle(handle);
>>     if (klass != null) {
>>       if (klass instanceof TypeArrayKlass) return new TypeArray(handle, 
>> this);
>>  + if (klass instanceof FlatArrayKlass) return new FlatArray(handle, this);
>>       if (klass instanceof ObjArrayKlass) return new ObjArray(handle, this);
>>       if (klass instanceof InstanceKlass) return new Instance(handle, this);
>>     }
>>     throw new UnknownOopException(handle.toString());
>>   }
>> 
>> 
>> Without the added code, this method throws UnknownOopException when it 
>> encounters a flattened array. That in turn causes the heap walking to stop 
>> scanning the region it is in, thinking that it has reached the top of the 
>> used part of the region. See ObjectHeap.iterateLiveRegions(). 
>> 
>> Tested tier1, tier2 svc, and tier5 svc CI testing with and w/o 
>> --enable-preview. Did tier5, tier6, and tier7 with --enable-preview on 
>> linux-x64-debug only.
>
> Chris Plummer has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   minor comment updates

Marked as reviewed by amenkov (Committer).

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

PR Review: 
https://git.openjdk.org/valhalla/pull/2271#pullrequestreview-4032324567

Reply via email to