0

When I run docker tomcat manager on 2 Debian servers I have these 2 displays:

Tomcat1: https://i.stack.imgur.com/kucJQ.png

Tomcat2: https://i.stack.imgur.com/ygOCh.png

Tomcat status memory pools are listed with different names as "PS < memory pool>" in Tomcat 1 and only "< memory pool >" in Tomcat 2 (like "PS Eden Space" vs "Eden Space").

Both container are run the same way :

docker run   --name tomcat-test   -it   -p 8083:8080   -v /tmp/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml   -v /tmp/context.xml:/tmp/context.xml   tomcat:8.5-jdk8-openjdk  /bin/bash -c "mv /usr/local/tomcat/webapps /usr/local/tomcat/webapps2; mv /usr/local/tomcat/webapps.dist /usr/local/tomcat/webapps; cp /tmp/context.xml /usr/local/tomcat/webapps/manager/META-INF/context.xml; catalina.sh run"

with same param xml files:

cat /tmp/context.xml
<Context antiResourceLocking="false" privileged="true" >
  <!--
    <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
  -->
  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>

and

# cat /tmp/tomcat-users.xml
<tomcat-users>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <user username="tomcat" password="s3cret" roles="manager-gui,manager-script"/>
</tomcat-users>

Both server are the same versions:

# cat /etc/debian_version
9.13

# docker version
Client: Docker Engine - Community
 Version:           19.03.15
 

Any idea why there is such difference? Shouldn't 2 containers running the same image do the sctrictly same behaviour? It's a small difference but I'm wondering if there is such difference I have seen, maybe there are other I don't see...

Meta
  • 5
  • 2

1 Answers1

0

The names of the memory pools depend on the garbage collector implementation used. This in turn depends on the characteristics (memory, number of real/virtual CPUs) of the servers on which the JVM runs.

The instance reporting memory pools prefixed by PS must be using the parallel garbage collector (see this question). The other instance is probably using the serial garbage collector.

See this answer on how the GC implementation used depends upon the characteristics of the server.

Piotr P. Karwasz
  • 12,857
  • 3
  • 20
  • 43
  • Indeed both server are same OS but different harware: 20G/2 vCPUs vs 15G/1 vCPU. I'll check that. thank you for help – Meta Dec 03 '21 at 13:10