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
2,656 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
• 59,230 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
• 59,230 points
2,169 views
0 votes
1 answer

How to launch a Docker container for MySQL?

Hi@akhtar, You can download MySQL image from the docker ...READ MORE

answered Jul 29, 2020 in Docker by MD
• 95,460 points
860 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,220 points

edited Oct 16, 2018 by lina 34,135 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
• 10,620 points
3,517 views
+2 votes
1 answer
+2 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
• 58,020 points
2,714 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
• 59,230 points
9,336 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP