title: Why the docker container memory usage doesn't decrease?
body: <p>I'm running a Java REST app with <a href="http://sparkjava.com/" rel="nofollow noreferrer">Apache JavaSpark</a> in this container, but I noticed that each request is adding the memory usage and not decreasing after the request is done. My first guess was that I had forgotten to close some stream/buffer (this app deal with a lot of file manipulation), but I reviewed all the code and looks like everything is being closed.</p>
  
  <p>Here is my Dockerfile:</p>
  
  <pre><code>FROM maven:3.5-jdk-8-alpine
  
  WORKDIR /code
  
  ADD pom.xml /code/pom.xml
  
  RUN ["mvn", "dependency:resolve"]
  
  ADD src /code/src
  
  RUN ["mvn", "package"]
  
  EXPOSE 1337
  
  CMD exec java -jar "target/app.jar"
  </code></pre>
  
  <p>Here is the docker stats:</p>
  
  <pre><code>CONTAINER           CPU %               MEM USAGE / LIMIT       MEM %               NET I/O             BLOCK I/O           PIDS
  2db8b2f5fd72        0.16%               66.36 MiB / 1.952 GiB   3.32%               12.9 kB / 106 kB    0 B / 0 B           23
  </code></pre>