-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add support for initial heap size #418
Comments
Hi @hafeezpk, if you want to add the Java Buildpack 3.X:Tell the memory calculator to apply 100% (default value) of the maximum heap value ( env:
JBP_CONFIG_OPEN_JDK_JRE: '[memory_calculator: {memory_initials: {heap: 100%}}]' As of Java Buildpack 4.X you first have to find out the heap size calculated by the memory calculator (e.g. using Java Buildpack 4.X:env:
JAVA_OPTS: -Xms512M This manual step, however, is potentially required for any change in your project that changes the amount of classes as the calculated By the way, I remember, that setting |
There are so many issues around setting -XX:+AlwaysPreTouch. If you could point me which part of the code i can change to include Xms alongside Xmx. I was wondering il have to modify the buildpack-memory-calculator and the make java-buildpack use that memory-calculator some how (haven't explored). |
After discussing this with the other Cloud Foundry teams, I don't believe that we'll be adding an automated way to set initial sizes of any of the memory regions. The previous memory calculator did this, but it caused a fair number of issues for both users and other components in the system. First off, users wouldn't understand why their applications, which had just started, were occupying the entire memory of their container (as reported by Cloud Foundry), but not occupying all the memory as reported by the JVM. In addition, on the Cloud Foundry side, attempts to automatically scale applications as they approached memory and CPU limits were impossible with Java applications as they were, from inception, occupying nearly 100% of the memory space (again as reported by Cloud Foundry). While there were definite advantages to starting with a matching initial and maximum size (especially for heap where it would delay the first GC), it appears that the cons have outweighed the pros enough that we won't be carrying it forward into the new memory calculator. |
The build pack although generates only -Xmx, it would be nice to also have a initial value for the heap size. I in my particular case, would like to have a -Xms with same value as the -Xmx (to avoid swaps).
The text was updated successfully, but these errors were encountered: