For performance testing needs, write a simple JSP page:
<%@ Page ContentType="Text/html;charset=utf-8"language="Java"%><HTML><Head><Body> <% LongL=System.currenttimemillis (); Doubles=MATH.CBRT (L); if((S*2)%8==0){ %>Docker is<%=L%> <% } %></Body></HTML>
During the testing process, it was found that there was a leak in the JVM heap! This is really confusing. After Baidu found to load JSP every request to accept Tomcat, will open a session for this request, and this session occupied by the memory for a period of time to release!
Make the following adjustments,
1. JSP compiler instructions to join the session configuration:
<%@ Page ContentType="Text/html;charset=utf-8"language="Java" session="false" %>
2. The expiration time of the configured session in Tomcat is 0
< Session-config > < Session-timeout ></session-timeout></session-config >
Problem solved!
JVM Heap overflow due to JSP empty page