Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leakage in Docker #31676

Closed
sravanpsk opened this issue Mar 9, 2017 · 4 comments
Closed

Memory leakage in Docker #31676

sravanpsk opened this issue Mar 9, 2017 · 4 comments

Comments

@sravanpsk
Copy link

Description:

While trying to deploy spring boot application built as a docker image it is consuming too much memory in docker integrated with open shift whereas the same image started in docker local consumes less than half of the memory.

Version
$ docker version
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Wed Jan 11 00:23:16 2017
OS/Arch: windows/amd64

Server:
Version: 1.13.1
API version: 1.26
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 08:47:51 2017
OS/Arch: linux/amd64

Steps To Reproduce

  1. Create a hello-world microservice based on Spring Boot.
  2. Build it as docker image
  3. Run the docker image in docker local. Check memory consumption with docker stats

Current Result

Memory consumption is docker installed in local machine is 116.7 MiB. but when pulled the same image to docker installed in openshift it is twice the memory consumption in local docker which is 385.9 MiB. Please see the document attached for more info.

Expected Result

Memory Consumption should be somewhat similar to local.

HelloWorldTestApllication - Docker.docx

@thaJeztah
Copy link
Member

Sounds like http://matthewkwilliams.com/index.php/2016/03/17/docker-cgroups-memory-constraints-and-java-cautionary-tale/, https://www.infoq.com/news/2017/02/java-memory-limit-container

The JVM is no stranger to this. If the maximum memory limit hasn’t been specified with -Xmx, the JVM will set it as a fraction of the physical memory (typically a fourth, but it may vary); this may not take into account the limits imposed by the container.

@antoinetran
Copy link

Interesting. So better always fix a Xmx in production?

@thaJeztah
Copy link
Member

Yes, also see #15020, and there's hope; upcoming JVM will be container aware; http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/5f1d1df0ea49

@thaJeztah
Copy link
Member

Let me close this issue, because I think this is a duplicate of #15020, and not a Docker bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants