Docker jetty container JVM memory allocation
<p>I am new to using Docker and have written a compose file for my application. It utilizes jetty and MySQL DB. I configured JVM memory for Jetty via <strong>JAVA_OPTS</strong> in the environment parameter.  I thought the maximum memory setting for jetty JVM was 1GB. However, When I run the commands below, it shows that jetty has consumed 2 GB. Please help on how to configure the JVM memory for jetty and ensure the same.</p>

<p><strong><em>docker-compose.yml</em></strong></p>

<pre><code>my-app:
  image: jetty
 environment:
     JAVA_OPTS: "-Xmx1024m -Xms128m"
</code></pre>

<p><strong><em>Status CMD</em></strong></p>

<pre><code>docker stats $(docker ps|grep -v "NAMES"|awk '{ print $NF }'|tr "\n" " ")

CONTAINER           CPU %               MEM USAGE / LIMIT     MEM %               NET I/O               BLOCK I/O
my-app           0.05%               2.188 GB / 10.56 GB   6.39%               12.66 kB / 1.584 kB   57 MB / 45.06 kB
</code></pre>