Skip to content

Commit

Permalink
change softmx relationship versus -Xms
Browse files Browse the repository at this point in the history
  • Loading branch information
kangyining committed Sep 27, 2023
1 parent 3079890 commit 715137f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions runtime/gc_modron_startup/mminit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3199,20 +3199,13 @@ gcReinitializeDefaultsForRestore(J9VMThread* vmThread)
candidateSoftMx = extensions->computeDefaultMaxHeapForJava(false);
}
/* We will set softMx value only if maxHeap calculation returned us a smaller
* value than existing maxHeap or softMx values, and a larger value than existing
* minHeap value as inherited from/established at snapshot run.
* value than existing maxHeap or softMx values (or softMx isn't previously set),
* and set the softMx to be the maximum of -Xms (initial memory size) and the
* candidateSoftMx
*/
if (extensions->memoryMax > candidateSoftMx) {
if ((0 == extensions->softMx) || (extensions->softMx > candidateSoftMx)) {
if (extensions->initialMemorySize > candidateSoftMx) {
uintptr_t minimumSizeValue = extensions->initialMemorySize;
const char *qualifier = NULL;
qualifiedSize(&minimumSizeValue, &qualifier);
j9nls_printf(PORTLIB,J9NLS_ERROR,J9NLS_GC_SUBSPACE_TOO_SMALL_FOR_VALUE, "-Xsoftmx", minimumSizeValue, qualifier);
goto _error;
} else {
extensions->softMx = candidateSoftMx;
}
extensions->softMx = max(candidateSoftMx, extensions->initialMemorySize);
}
}
}
Expand Down

0 comments on commit 715137f

Please sign in to comment.