# INFO: os::commit\_memory(X, X, 0) failed; error='Cannot allocate memory' (errno=12)

**URL:** <https://discuss.elastic.co/t/info-os-commit-memory-x-x-0-failed-error-cannot-allocate-memory-errno-12/102759>\
**Category:** Elasticsearch\
**Created:** [October 4, 2017, 8:37pm UTC](https://discuss.elastic.co/t/info-os-commit-memory-x-x-0-failed-error-cannot-allocate-memory-errno-12/102759 "2017-10-04T20:37:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [October 4, 2017, 8:37pm UTC](https://discuss.elastic.co/t/info-os-commit-memory-x-x-0-failed-error-cannot-allocate-memory-errno-12/102759/1 "2017-10-04T20:37:10Z")

</div>

I'm trying to follow [Google Cloud Storage Repository Plugin | Elasticsearch Plugins and Integrations [5.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/plugins/5.6/repository-gcs.html) and while executing command, I'm getting following error:

```
# docker exec -it elasticsearch bin/elasticsearch-plugin install repository-gcs
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00007fc435200000, 22905094144, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 22905094144 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /usr/share/elasticsearch/hs_err_pid1286.log
#

```

"workaround" is to restart container and then try again:

```
# docker-compose restart
Restarting elasticsearch13 ... done
# docker exec -it elasticsearch bin/elasticsearch-plugin install repository-gcs
-> Downloading repository-gcs from elastic
[=================================================] 100%?? 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission setFactory
* java.lang.reflect.ReflectPermission suppressAccessChecks
* java.net.URLPermission http://www.googleapis.com/* *:
* java.net.URLPermission https://www.googleapis.com/* *:
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed repository-gcs
# 

```

* * *

Is there a way to build repository-gcs elasticsearch plugin into image somehow? this way I won't have to repeat installation/configuration steps every time I have to take elasticsearch container down) or perhaps there a better way to handle this issue all together?

Please advise.

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [October 10, 2017, 3:20pm UTC](https://discuss.elastic.co/t/info-os-commit-memory-x-x-0-failed-error-cannot-allocate-memory-errno-12/102759/2 "2017-10-10T15:20:16Z")

</div>

[Install Elasticsearch with Docker | Elasticsearch Reference [5.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_c_customized_image)

```
# cat Dockerfile 
FROM docker.elastic.co/elasticsearch/elasticsearch:5.6.2
RUN bin/elasticsearch-plugin install repository-gcs
ADD X-X.json /
RUN bin/elasticsearch-keystore create
RUN bin/elasticsearch-keystore add-file gcs.client.default.credentials_file /X-X.json
#
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 7, 2017, 3:20pm UTC](https://discuss.elastic.co/t/info-os-commit-memory-x-x-0-failed-error-cannot-allocate-memory-errno-12/102759/3 "2017-11-07T15:20:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
