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, 2019 in Docker by Nizam
284 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, 2019 by Sirajul
• 50,480 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, 2019 in Docker by Sirajul
• 50,480 points
315 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,200 points

edited Oct 16, 2018 by lina 9,324 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,940 points
780 views
+1 vote
12 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
• 57,530 points
450 views
0 votes
1 answer
0 votes
1 answer

What is the process for stopping and restarting a docker container?

If you want to stop a docker ...READ MORE

answered Jul 3, 2019 in Docker by Sirajul
• 50,480 points
258 views