Cover Image

Unable to lock JVM Memory: error=12, reason=Cannot allocate memory

March 27, 2020 - Reading time: 2 minutes

Photo by photo hoteam on Unsplash

Yes, I'm back to Linux and this is the first issue I faced installing my all development environment, basically, the issue was happening because my elasticsearch image complaining about memory.

Luckily, the issue was solved by modifying the docker-compose.yml file, adding unlimited memory as follows:

version: '3'

services:
   elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.6.1
        container_name: elasticsearch
        volumes:
            ...
        ports:
           ...
        environment:
            ...
        ulimits:
            memlock:
                soft: -1
                hard: -1

Also, for some reason was failing with the older version of this image, so I updated from 6.2.2 to 7.6.1

About

After having lost my previous blog, this is a new intent to be back to writing content for the web, this site its a place to talk about stories, experiences and how I deal with my digital life.