-
Notifications
You must be signed in to change notification settings - Fork 752
IBM Java enforces default max heap size on startup, when larger -Xms is specified #14386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@joransiu and I had been discussing about a critical case when we came across this issue. Recently we had a critical customer issue on Z/OS where: a) Customer had a small available memory (less than 1g) The error message was not very helpful. Also, when Xms is specified without an Xmx, if Xmx by default is matched with Xms, it would be more meaningful and intuitive to the user. Our suggestions are:
These would help user to fix the problem by themselves. @dmitripivkine fyi. |
In the case if maximum heap size is not specified and taken by default and initial heap size is specified and initial value is larger than default maximum increase maximum heap size to match initial size. Related eclipse-openj9#14386 Signed-off-by: Dmitri Pivkine <[email protected]>
In the case if maximum heap size is not specified and taken by default and initial heap size is specified and initial value is larger than default maximum increase maximum heap size to match initial size. Related eclipse-openj9#14386 Signed-off-by: Dmitri Pivkine <[email protected]>
In the case if maximum heap size is not specified and taken by default and initial heap size is specified and initial value is larger than default maximum increase maximum heap size to match initial size. Related eclipse-openj9#14386 Signed-off-by: Dmitri Pivkine <[email protected]>
In the case if maximum heap size is not specified and taken by default and initial heap size is specified and initial value is larger than default maximum increase maximum heap size to match initial size. Related eclipse-openj9#14386 Signed-off-by: Dmitri Pivkine <[email protected]>
Resolved with #21602 |
If the user specifies an -Xms value that is larger than the default max heap size, and does not specify -Xmx, the JVM fails to start, because it enforces the default -Xmx. Note also that the error message IBM Java gives in this scenario is somewhat cryptic:
JVMJ9GC020E -Xms too large for heap
This does not tell the user what the real problem is (default -Xmx), or how to fix it.
In this situation, it would be more user-friendly for the JVM to start, with -Xmx set equal to the user-specified -Xms, since the user clearly wants a heap at least as big as the -Xms value. (this assumes the system free memory accommodates the specified -Xms)
That is how Oracle Java handles the situation, by the way: If the user-specified -Xms is larger than the default MaxHeapSize, the JVM starts with MaxHeapSize set equal to the user-specified -Xms value.
The text was updated successfully, but these errors were encountered: