-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Modify wording relating to HotSpot JVM compressed oops #455
Conversation
This commit modifies the wording around using compressed oops on the HotSpot JVM. In particular, an attempt is made to make clear that the boundary is not exact, to remove the usage of floating point numbers as this can confuse people when trying to set their max heap size on the JVM, and to provide documentation for how to check whether or not the provided settings enable or disable compressed oops. Relates elastic/elasticsearch#15445
Would @clintongormley or @polyfractal mind taking a look? |
makes the GC struggle with large heaps. | ||
|
||
With the HotSpot JVM, you can verify that your max heap size setting enables compressed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this a TIP block, just add TIP:
at the beginning of the sentence.
Is there any easy way to know what the cutoff is for a particular JVM? Or to know if you've crossed the boundary on a running JVM? |
I believe the motivation for the change from "~32gb" -> "30.5gb" was to ensure that everyone benefitted from compressed OOPs regardless of their individual JVMs. E.g. when you read "just under 32gb", most people will set it to "31.9" or similar and may/may not benefit from the compressed oops. So someone (@markwalkom I think?) made the change to give enough wiggle room to always work. I didn't realize decimals were disallowed though. I wonder if we should make a note somewhere about that too? Perhaps we can explain "a little under 32gb" a bit more in the Tip? I just want to make sure people don't read this and say "Ok, i'll set it to 31.999 since that's just under". Maybe expand the Tip to something like this? *note: pre-coffee, no claims of beautiful prose :) * Just how far under 32gb should I set the JVM? Unfortunately, that depends. The exact cutoff varies by JVMs and platforms. If you want to play it safe, setting the heap to For example, here we test a Java 1.7 installation on MacOSX and see the max heap size is around 32600mb (~31.83gb) before compressed pointers are disabled:
In contrast, a Java 1.8 installation on the same machine has a max heap size around 32766mb (~31.99gb):
The morale of the story is that the exact cutoff for max heap size in bytes that allows compressed oops varies from JVM to JVM, so take caution when taking examples from elsewhere and be sure to check your system with your configuration and your JVM. |
Also, tangentially, is there a way we can have ES spit out this information in the startup log? That'd really be the most user-friendly option. |
@clintongormley Not anything straightforward that I'm aware of.
On a running JVM, you can check the status of
if
if |
@clintongormley @polyfractal I've opened elastic/elasticsearch#15489 to get the status of |
Sorry for the delay on this. I expanded the "empirically testing" portion a bit and just merged. Thanks! |
This commit modifies the wording around using compressed oops on the
HotSpot JVM. In particular, an attempt is made to make clear that the
boundary is not exact, to remove the usage of floating point numbers as
this can confuse people when trying to set their max heap size on the
JVM, and to provide documentation for how to check whether or not the
provided settings enable or disable compressed oops.
Relates elastic/elasticsearch#15445