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

Matias Saavedra Silva matsaave at openjdk.org
Mon Jun 2 16:41:07 UTC 2025


On Mon, 2 Jun 2025 15:25:12 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> 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
> }
> ```

I forgot this existed, thanks for pointing it out!

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

PR Comment: https://git.openjdk.org/jdk/pull/25591#issuecomment-2931529934


More information about the hotspot-runtime-dev mailing list