Skip to content

Commit 90d2ca0

Browse files
committed
Use LDR_CNTRL on AIX to use 64KB pages and modify removeAixExpectedVars
Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
1 parent e84e685 commit 90d2ca0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/java.base/unix/native/libjli/java_md.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
/*
2727
* ===========================================================================
28-
* (c) Copyright IBM Corp. 2020, 2023 All Rights Reserved
28+
* (c) Copyright IBM Corp. 2020, 2024 All Rights Reserved
2929
* ===========================================================================
3030
*/
3131

@@ -312,6 +312,11 @@ CreateExecutionEnvironment(int *pargc, char ***pargv,
312312
if (setenv(mallocOptionsName, mallocOptionsValue, 0) != 0) {
313313
fprintf(stderr, "setenv('MALLOCOPTIONS=multiheap,considersize') failed: performance may be affected\n");
314314
}
315+
const char * ldrCntrlName = "LDR_CNTRL";
316+
const char *ldrCntrlValue = "TEXTPSIZE=64K@DATAPSIZE=64K@STACKPSIZE=64K@SHMPSIZE=64K";
317+
if (setenv(ldrCntrlName, ldrCntrlValue, 0) != 0) {
318+
fprintf(stderr, "setenv('LDR_CNTRL=TEXTPSIZE=64K@DATAPSIZE=64K@STACKPSIZE=64K@SHMPSIZE=64K') failed: performance may be affected\n");
319+
}
315320
#endif
316321

317322
#ifdef SETENV_REQUIRED

test/jdk/java/lang/ProcessBuilder/Basic.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* ===========================================================================
26-
* (c) Copyright IBM Corp. 2020, 2022 All Rights Reserved
26+
* (c) Copyright IBM Corp. 2020, 2024 All Rights Reserved
2727
* ===========================================================================
2828
*/
2929

@@ -810,8 +810,9 @@ private static String removeMacExpectedVars(String vars) {
810810
*/
811811
private static String removeAixExpectedVars(String vars) {
812812
String cleanedVars = vars.replace("AIXTHREAD_GUARDPAGES=0,", "");
813-
// OpenJ9 adds MALLOCOPTIONS
813+
// OpenJ9 adds MALLOCOPTIONS and LDR_CNTRL
814814
cleanedVars = cleanedVars.replace("MALLOCOPTIONS=multiheap,considersize,", "");
815+
cleanedVars = cleanedVars.replace("LDR_CNTRL=TEXTPSIZE=64K@DATAPSIZE=64K@STACKPSIZE=64K@SHMPSIZE=64K,", "");
815816
return cleanedVars;
816817
}
817818

0 commit comments

Comments
 (0)