On Fri, 27 Mar 2026 04:48:39 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. This pull request has now been integrated. Changeset: 06c2cb1e Author: Chris Plummer <[email protected]> URL: https://git.openjdk.org/valhalla/commit/06c2cb1eaee6b035a148ac072e7150b640d4a988 Stats: 76 lines in 4 files changed: 72 ins; 0 del; 4 mod 8381115: [lworld] There are a number of SA tests failing with --enable-preview due partial FlatArrayKlass support Reviewed-by: amenkov ------------- PR: https://git.openjdk.org/valhalla/pull/2271
