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
42 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
• 38,820 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
• 38,820 points
41 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,110 points

edited Oct 16, 2018 by lina 5,390 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,870 points
413 views
+1 vote
11 answers

How can I run a ‘docker exec’ command inside a docker container?

Use bash with -c docker exec -it CONTAINER_ID ...READ MORE

answered Dec 10, 2018 in Docker by Kiyara
127,187 views
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,940 points
228 views
0 votes
1 answer
0 votes
1 answer