docker-library / openjdk

Docker Official Image packaging for EA builds of OpenJDK from Oracle
http://openjdk.java.net
MIT License
1.14k stars 471 forks source link

Process needs nearly 125% extra memory to run fast #451

Closed rielec closed 3 years ago

rielec commented 3 years ago

Hi, I'm developing microservices using docker + spring + openjdk.

As far as I know, all openjdk versions are aware of the container's memory restrictions and can be modified using MaxRAMPercentage and MinRAMPercentage parameters.

Checking the memory usage of the microservices I'm developing, I see that only about 30 - 50Mb are needed for each one, but I need to change the MaxRAMPercentage to 95.0 and give about 125Mb to each container in order to make them run fast. If the container has less than that it runs significantly slower.

Why should I give this 125% extra memory to the container to run 'fast'? I guess that you should always give to the container a bit more memory that it needs, but that so much? I'm sure I'm missing something here and I wonder if you could clarify why this ishappening or just put me in the right direction so I could do some research to underestand it.

Thank you! Regards.

wglambert commented 3 years ago

You could try asking over at the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since these repos aren't really a user-help forum