-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Java VM for Docker allocates 1GB memory even if less is specified, unless bootstrap.memory_lock=false #5865
Java VM for Docker allocates 1GB memory even if less is specified, unless bootstrap.memory_lock=false #5865
Comments
Feels like a bug. The recommendation is to have half of instance's memory allocated for OpenSearch[1] but looks like [1] https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/ |
The error shows up when memory is locked because that prevents paging to expand the addressable space. The same memory is likely being requested with memory_lock false, but results in paging. Note that See the "Class Metadata" section here I'll test this a bit, as well as look into the minimum requirements and we should definitely update our documentation to include this information. |
Hey @pszabop I've done various experiments over the weekend and narrowed it down to the JVM's Compressed Class Space. The space is "reserved" but not used, which when combined with You can use the Let me know if this works for you and I'll look for ways to improve our documentation. |
Closing this as it's been documented in opensearch-project/documentation-website#3266 |
Describe the bug
The Java VM for Docker allocates 1GB of memory if
bootstrap.memory_lock=true
no matter the settings for"OPENSEARCH_JAVA_OPTS=-Xms128m -Xmx128m"
To Reproduce
Steps to reproduce the behavior:
docker run -d -p 9200:9200 -p 9600:9600 -e "bootstrap.memory_lock=true" -e "OPENSEARCH_JAVA_OPTS=-Xms128m -Xmx128m" -e "discovery.type=single-node" opensearchproject/opensearch:latest
1073741824
bytes of memory. This is far larger than the memory specified underOPENSEARCH_JAVA_OPTS
above[Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memory]
bootstrap.memory_lock=false
the error doesn't occurExpected behavior
The bootstrap should allocate no more memory than
OPENSEARCH_JAVA_OPTS
specifiesPlugins
None
Screenshots
See error messages noted above
Host/Environment (please complete the following information):
AWS t2.micro using recent wizard
Linux 5.10.157-139.675.amzn2.x86_64 #1 SMP Thu Dec 8 01:29:11 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Docker version 20.10.17, build 100c701
Docker Compose version v2.15.1
Additional context
docker-compose fails without even the above message. Separate issue was filed.
I'm using a static index for a small-ish document (KJV Bible), and there aren't really good instructions for running opensearch in a small VM. If this is a weird corner case for you, feel free to close, but posting the workaround here for small VMs may be useful to others
The text was updated successfully, but these errors were encountered: