I'm running Tomcat 8.0.50
with JDK 1.8.0 update 111
, on a box with 128 GB
memory.
It's a default installation with no JAVA_OPTS configured, during pressure tests of a simple JSP file,
<%@ page import="java.io.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
String normal_querystring = "?params=whatever";
session.setAttribute("time", normal_querystring+System.currentTimeMillis());
%>
The memory usage continue to grow,
root 21056 123 17.9 40884708 23744644 pts/1 Sl 11:10 52:18 /home/work/jdk1.8.0_111/jre/bin/java -Djava.util.logging.config.file=/home/test/apache-tomcat-8.0.50/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dignore.endorsed.dirs= -classpath /home/test/apache-tomcat-8.0.50/bin/bootstrap.jar:/home/test/apache-tomcat-8.0.50/bin/tomcat-juli.jar -Dcatalina.base=/home/test/apache-tomcat-8.0.50 -Dcatalina.home=/home/test/apache-tomcat-8.0.50 -Djava.io.tmpdir=/home/test/apache-tomcat-8.0.50/temp org.apache.catalina.startup.Bootstrap start
I know that Java would use 1/4 of the physical memory available, but how could a simple JSP file like this consuming so much memory?
Also, gc does not work:
> jcmd 21056 GC.run
21056:
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
at sun.tools.jcmd.JCmd.executeCommandForPid(JCmd.java:147)
at sun.tools.jcmd.JCmd.main(JCmd.java:131)
Any ideas?