Memory requirement issue for a docker container

0 votes
I need to create a docker container in which I need to run a java application. Since i am not really sure about the usage of resources by the java application i need to allocate some extra memory space for my container just as a precautionary measure so that it I dont encounter an out of memory error.How do I go about doing this? Any suggestions would be of help!
Jul 4 in Docker by Nizam
14 views

1 answer to this question.

0 votes

Docker provides ways to control how much memory, or CPU a container can use, setting runtime configuration flags of the docker run command.

You could use --memory-swap which is a modifier flag along with the docker run command.Using swap allows the container to write excess memory requirements to disk when the container has exhausted all the RAM that is available to it. There is a performance penalty for applications that swap memory to disk often.

For a further understanding refer: https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details

answered Jul 4 by Sirajul
• 5,960 points

Related Questions In Docker

0 votes
1 answer

How to disable networking stack for a docker container?

If you want to completely disable the ...READ MORE

answered Jul 4 in Docker by Sirajul
• 5,960 points
9 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,100 points

edited Oct 16, 2018 by lina 3,225 views
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 9,430 points
267 views
+2 votes
11 answers
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,160 points
99 views
0 votes
1 answer
0 votes
1 answer