-
Notifications
You must be signed in to change notification settings - Fork 505
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
Document class metadata memory reservation impacts #3266
Conversation
Signed-off-by: Daniel Widdis <widdis@gmail.com>
@@ -71,6 +71,8 @@ The [sample docker-compose.yml]({{site.url}}{{site.baseurl}}/install-and-configu | |||
|
|||
Disables swapping (along with `memlock`). Swapping can dramatically decrease performance and stability, so you should ensure it is disabled on production clusters. | |||
|
|||
Enabling the `bootstrap.memory_lock` setting will cause the JVM to reserve any memory it needs. On VMs with limited memory (such as t2.micro with 1GB) the [default 1GB Class Metadata](https://docs.oracle.com/javase/10/gctuning/other-considerations.htm#JSGCT-GUID-BFB89453-60C0-42AC-81CA-87D59B0ACE2E) native memory reservation result in error due to the lack of native memory. To prevent errors, limit the reserved memory size using `-XX:CompressedClassSpaceSize` or `-XX:MaxMetaspaceSize` and set the size of the Java heap to make sure you have enough system memory. |
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.
Please remove the reference to t2.micro
as that's specific to Amazon and this documentation should be platform agnostic.
For the link (i.e., [default 1GB Class Metadata](https://docs.oracle.com/javase/10/gctuning/other-considerations.htm#JSGCT-GUID-BFB89453-60C0-42AC-81CA-87D59B0ACE2E)
) I'm not sure, as a reader, where on that page I'm supposed to look. Ctrl+F looking for 1 GB
and 1GB
on that page yield no results. Please add context to the link so the reader knows why they're being sent to the other page.
Formal cross-references should also, ideally, match the title of the page you link to. See Source: https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#links
Typo: native memory reservation result in error due to the lack of native memory.
Singular "reservation" or wrong conjugated form of the verb "result." Should be "reservations result" or "reservation results."
Also, when describing a unit of measure make sure to add a space between the number and the unit. So 1GB
should be written as 1 GB
. Source: https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#numbers-and-measurement
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.
Thanks for the review, @JeffH-AWS . I've removed the AWS-specific reference and fixed the grammar. I also changed the link to include terms that would show up in a search on that page, specifically "1 gigabyte (GB)".
I did include "Class Metadata" in the link as well, which is the section on that page relevant to this discussion; and in fact someone tuning memory on a small VM would probably want to read that whole section.
I could not find any other way to more directly reference that content. This link would work on Chrome, but not other browsers.
Let me know if I should change this to something like this:
Enabling the bootstrap.memory_lock
setting will cause the JVM to reserve any memory it needs. The Java Platform, Standard Edition HotSpot Virtual Machine Garbage Collection Tuning Guide section on Class Metadata documents a default 1 gigabyte (GB) Class Metadata native memory reservation. Combined with Java heap, this may result in an error due to the lack of native memory on VMs with less memory than these requirements. To prevent errors, limit the reserved memory size using -XX:CompressedClassSpaceSize
or -XX:MaxMetaspaceSize
and set the size of the Java heap to make sure you have enough system memory.
Alternate less verbose title: "Java SE Hotspot VM Garbage Collection Tuning Guide"
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.
That sounds great! Very nice work thanks so much Daniel!
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.
That sounds great! Very nice work thanks so much Daniel!
I'm not sure if "that sounds great" is to my proposal in the comment above, or the commit I already pushed?
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
* Document class metadata memory reservation impacts Signed-off-by: Daniel Widdis <widdis@gmail.com> * Update index.md * Address review comments Signed-off-by: Daniel Widdis <widdis@gmail.com> * Revise wording for more clarity Signed-off-by: Daniel Widdis <widdis@gmail.com> --------- Signed-off-by: Daniel Widdis <widdis@gmail.com> Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> (cherry picked from commit 5fb54e3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Document class metadata memory reservation impacts * Update index.md * Address review comments * Revise wording for more clarity --------- (cherry picked from commit 5fb54e3) Signed-off-by: Daniel Widdis <widdis@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
…t#3266) * Document class metadata memory reservation impacts Signed-off-by: Daniel Widdis <widdis@gmail.com> * Update index.md * Address review comments Signed-off-by: Daniel Widdis <widdis@gmail.com> * Revise wording for more clarity Signed-off-by: Daniel Widdis <widdis@gmail.com> --------- Signed-off-by: Daniel Widdis <widdis@gmail.com> Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Description
The
bootstrap.memory_lock=true
imposes a hard lower limit on native memory reservation by the JVM, which include 1 GB for class metadata in addition to heap space.On small VMs (such as t1.micro) with only 1 GB space, this results in out of memory errors.
This change updates the documentation to alert users to this setting.
Issues Resolved
Fixes opensearch-project/OpenSearch#5865
Checklist
For more information on following Developer Certificate of Origin and signing off your commits, please check here.