RFR: 8345347: Test runtime/cds/TestDefaultArchiveLoading.java should accept VM flags or be marked as flagless

Stefan Karlsson stefank at openjdk.org
Mon Jun 2 15:27:51 UTC 2025


On Mon, 2 Jun 2025 14:39:55 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

> Currently this test uses `ProcessTools.createLimitedTestJavaProcessBuilder()` to ignore vm flags, so this patch changes the method to `ProcessTools.createTestJavaProcessBuilder()` to allow for more extensive training. Because ZGC is incompatible with heap dumping, is is disabled on this test. Verified locally and through tiered testing.

We already have this property that is used for some tests:

@requires vm.cds.write.archived.java.heap


Should this be used here instead of explicitly excluding ZGC?

This property boils down to:

// If an incompatible VM options is found, return a text message that explains why
static const char* check_options_incompatible_with_dumping_heap() {
#if INCLUDE_CDS_JAVA_HEAP
  if (!UseCompressedClassPointers) {
    return "UseCompressedClassPointers must be true";
  }

  // Almost all GCs support heap region dump, except ZGC (so far).
  if (UseZGC) {
    return "ZGC is not supported";
  }

  return nullptr;
#else
  return "JVM not configured for writing Java heap objects";
#endif
}

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

Changes requested by stefank (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25591#pullrequestreview-2888935605


More information about the hotspot-runtime-dev mailing list