Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Out of memory #8

Closed
Madhu1512 opened this issue Sep 28, 2016 · 9 comments
Closed

Out of memory #8

Madhu1512 opened this issue Sep 28, 2016 · 9 comments

Comments

@Madhu1512
Copy link

  • docker info output:
    Containers: 1
    Running: 0
    Paused: 0
    Stopped: 1
    Images: 1
    Server Version: 1.12.1
    Storage Driver: aufs
    Root Dir: /mnt/sda1/var/lib/docker/aufs
    Backing Filesystem: extfs
    Dirs: 12
    Dirperm1 Supported: true
    Logging Driver: json-file
    Cgroup Driver: cgroupfs
    Plugins:
    Volume: local
    Network: bridge host null overlay
    Swarm: inactive
    Runtimes: runc
    Default Runtime: runc
    Security Options: seccomp
    Kernel Version: 4.4.17-boot2docker
    Operating System: Boot2Docker 1.12.1 (TCL 7.2); HEAD : ef7d0b4 - Thu Aug 18 21:18:06 UTC 2016
    OSType: linux
    Architecture: x86_64
    CPUs: 1
    Total Memory: 995.9 MiB
    Name: default
    ID: TB75:KOH5:72FN:A4SU:GYFS:C5T7:ZBHF:ANUV:ZA2T:THIT:CQRC:2H72
    Docker Root Dir: /mnt/sda1/var/lib/docker
    Debug Mode (client): false
    Debug Mode (server): true
    File Descriptors: 14
    Goroutines: 27
    System Time: 2016-09-28T00:18:22.642337481Z
    EventsListeners: 1
    Registry: https://index.docker.io/v1/
    Labels:
    provider=virtualbox
    Insecure Registries:
    127.0.0.0/8
  • docker-compose version:

docker-compose version
docker-compose version 1.8.0, build unknown
docker-py version: 1.9.0
CPython version: 2.7.10
OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016

  • Host OS and version:

OS X EI Capitan Version 10.11.6

Bug description

trying to run the docker image on Mac Osx and seeing the following error.

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Out of memory' (errno=12)

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.

An error report file with more information is saved as:

/usr/share/elasticsearch/hs_err_pid1.log

@jordansissel
Copy link

This sounds more like a boot2docker problem. It looks like, from the data you provided. Docker sees the boot2docker vm having approximately 1GB of memory (Total Memory: 995.9 MiB), and Elasticsearch is asking for approximately 2GB (failed to map 2060255232 bytes).

From this, you'll either want to give your vm more memory or reduce the heap size for Elasticsearch.

@Madhu1512
Copy link
Author

@jordansissel thank you so much. It Solved.

@jobwat
Copy link

jobwat commented Jun 30, 2017

For the next one searching:

-e ES_JAVA_OPTS="-Xms512m -Xmx512m"

Found there #43

@ebuildy
Copy link

ebuildy commented Nov 13, 2017

This is no more working since 5.6, you must edit jvm.options file.

See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html

By default, it's 2Gb, since values are hardcoded, define them via environment variables have no effect.

@dliappis
Copy link
Contributor

See #43 (comment), overriding with env variables still works.

@stefan-cross
Copy link

I had to go through the following steps to get ES 5.6.5 up and running using docker machine on MacOS 10.12.6 with virtualbox:

docker-machine create -d virtualbox --virtualbox-memory 4096 default
docker-machine env default
eval $(docker-machine env default)
docker-machine ssh default
sudo sysctl --w vm.max_map_count=262144
exit
docker run -d -p 9200:9200 -p 9300:9300 -p 5601:5601 elasticsearch

@keesvanlierop
Copy link

@dliappis Same specs as OP here except OS is Ubuntu. Overriding with env variables doesn't seem to fix it there. Even with just 256m values ( ES_JAVA_OPTS: "-Xms256m -Xmx256m" ).

Error: OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000f5550000, 178978816, 0) failed; error='Cannot allocate memory' (errno=12)

Any idea what could be wrong here still?

@pushpender-sharma
Copy link

any idea?

@dliappis
Copy link
Contributor

dliappis commented Mar 1, 2019

@pushpender-sharma and every one else, it really is hard to understand what is the question here with different comments spanning across time. On top of that, this issue is closed.

Please open instead a topic in https://discuss.elastic.co/c/elasticsearch/ providing as much information as possible about your environment (underlying OS, docker info output, version of Elasticsearch docker image, how the container is being run).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants