WEB-server tomcat 9.0 works for 2-3 minutes and falls. In this case, the OutOfMemoryError error appears and absolutely all the allocated RAM for the application is used. I only appeal to the server - one client. Information for transmission not more than 100kb per request.
Works server on Windows 7 x32.
There are 4 servlets (doGet) running on the server that collect information about the device with the help of a class object and transfer it to .JSP.
- In 'catalina.propirties' I registered'org.apache.jasper.runtime.JspFactoryImpl.USE_POOL = false';
- Zero variables after transferring data to JSP. Zeroed variables after use in the JSP itself;
- Called System.gc () to force garbage collection;
- In 'web.xml' added a parameter to servlets: 'enablePool = false';
- 'In context.xml' added 'cachingAllowed = "false"'
None of this fixed the problem.
The profiler indicates a large number of Strin and Char elements, but all elements should be reset to zero after use on the server.
Where to look for a problem?
<%@page session="false"%>at the top (there was a case when we didn’t have a session on pages and it was overflow) - Chubatiyjvisualvm, make a heap dump there, then there is an opportunity to find N largest objects. The plus is that there you can see who refers to the object and to whom the object refers, i.e. you can find where your legs grow from. - Roman