Skip to content

Conversation

@mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Dec 2, 2025

This commit performs the following changes to memory disclaim heuristics:

  • The prefered location for disclaimed memory is now swap (used to be /tmp)
  • If swap is not available (or disallowed through -Xjit:dontDisclaimMemoryOnSwap) then the JIT will attempt to use /tmp
  • Disclaim is avoided if less than 1GB of disk space is available (on swap or /tmp respectively). This threshold can be changed with -Xjit:minDiskSpaceForDisclaim= (in MB)

@mpirvu mpirvu requested a review from dsouzai as a code owner December 2, 2025 16:36
@dsouzai dsouzai self-assigned this Dec 2, 2025
@dsouzai
Copy link
Contributor

dsouzai commented Dec 2, 2025

jenkins test sanity.function all jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented Dec 2, 2025

I discovered a potential 32-bit overflow when shifting J9::Options::_minDiskSpaceForDisclaimMB << 20 to compute size in bytes.
I addressed that issue in the forced push.

@mpirvu
Copy link
Contributor Author

mpirvu commented Dec 2, 2025

jenkins test sanity.function all jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented Dec 2, 2025

jenkins test sanity.functional all jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented Dec 3, 2025

There were two failures:
On AIX J9vmTest_1_FAILED failed while executing j9vm.test.arraylets.ArrayletAllocateTest:

        +++ j9vm.test.arraylets.ArrayletAllocateTest: +++
        command: /home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/jdkbinary/j2sdk-image/bin/java  -Xgcpolicy:metronome -Xnocompressedrefs  -Xdump -Xms63m -Xmx63m  -Xdisableexcessivegc   -classpath /home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/TKG/../../jvmtest/functional/VM_Test/VM_Test.jar:/home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/../../externalDependency/lib/asm-all.jar  j9vm.test.arraylets.ArrayletAllocateTest 

        JVMDUMP055I Processing dump event "systhrow", detail "java/lang/OutOfMemoryError", exception "Java heap space" at 2025/12/02 20:54:13 - please wait.
        JVMDUMP032I JVM requested System dump using '/home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/TKG/output_17647074713425/J9vmTest_1/core.20251202.205413.27853180.0001.dmp' in response to an event
        JVMDUMP010I System dump written to /home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/TKG/output_17647074713425/J9vmTest_1/core.20251202.205413.27853180.0001.dmp
        JVMDUMP032I JVM requested Heap dump using '/home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/TKG/output_17647074713425/J9vmTest_1/heapdump.20251202.205413.27853180.0002.phd' in response to an event
        JVMDUMP010I Heap dump written to /home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/TKG/output_17647074713425/J9vmTest_1/heapdump.20251202.205413.27853180.0002.phd
        JVMDUMP032I JVM requested Java dump using '/home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/TKG/output_17647074713425/J9vmTest_1/javacore.20251202.205413.27853180.0003.txt' in response to an event
        JVMDUMP010I Java dump written to /home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/TKG/output_17647074713425/J9vmTest_1/javacore.20251202.205413.27853180.0003.txt
        JVMDUMP032I JVM requested Snap dump using '/home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/TKG/output_17647074713425/J9vmTest_1/Snap.20251202.205413.27853180.0004.trc' in response to an event
        JVMDUMP010I Snap dump written to /home/jenkins/workspace/Test_openjdk21_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/TKG/output_17647074713425/J9vmTest_1/Snap.20251202.205413.27853180.0004.trc
        JVMDUMP056I Processed dump event "systhrow", detail "java/lang/OutOfMemoryError" at 2025/12/02 20:54:16 (2.716 seconds).
        Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        	at j9vm.test.arraylets.ArrayletAllocateTest.main(ArrayletAllocateTest.java:79)
        non-zero exit value: 1
        *** Test FAILED *** (j9vm.test.arraylets.ArrayletAllocateTest)

On Windows two SCC tests failed, mostly when trying to destroy a SCC:

        ---SUMMARY OF FAILED TESTS---
        Test 58 clean-up
        Test 69-f: cleanup
        Test 71-b: Re-use the shared cache in readonly mode, which should detect the page difference
        Test 71-c: Re-use the shared cache, which should detect the page difference

        testSCCMLTests1_openj9_3_FAILED
        ---SUMMARY OF FAILED TESTS---
        Test 67-c: Clean up
        Test 72-d: destroy cache for cleanup
        -----------------------------
        
        -----------------------------------
        testSCCMLTests1_openj9_2_FAILED

@mpirvu
Copy link
Contributor Author

mpirvu commented Dec 3, 2025

The same failures occurred again in small grinders. The platforms involved, AIX and Windows, do not use disclaiming. I am going to slightly change the code to be absolutely sure that we don't execute any of the disclaiming code on platforms other than Linux.

This commit performs the following changes to memory disclaim heuristics:
- The prefered location for disclaimed memory is now swap (used to be /tmp)
- If swap is not available (or disallowed through -Xjit:dontDisclaimMemoryOnSwap)
  then the JIT will attempt to use /tmp
- Disclaim is avoided if less than 1GB of disk space is available
  (on swap or /tmp respectively). This threshold can be changed with
  -Xjit:minDiskSpaceForDisclaim=<NNN> (in MB)

Signed-off-by: Marius Pirvu <mpirvu@ca.ibm.com>
@mpirvu
Copy link
Contributor Author

mpirvu commented Dec 3, 2025

jenkins test sanity all jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented Dec 3, 2025

FYI @JamesKingdon since some of our customers raised issues with respect to disclaiming.

@dsouzai
Copy link
Contributor

dsouzai commented Dec 3, 2025

jdk11 win failure is infra related:

[2025-12-03T19:58:08.296Z] Test result: FAILED
[2025-12-03T19:58:08.296Z]  [ERR] JVMSHRC241E Error: unable to delete shared class cache file
[2025-12-03T19:58:08.296Z]  [ERR] JVMSHRC336E Port layer error code = -102
[2025-12-03T19:58:08.296Z]  [ERR] JVMSHRC337E Platform error message: (5) Access is denied.

@mpirvu
Copy link
Contributor Author

mpirvu commented Dec 4, 2025

All the tests passed except the one on windows due to infra.
This PR is ready to be merged.

@dsouzai dsouzai merged commit 297d476 into eclipse-openj9:master Dec 4, 2025
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants