V
V
Vyacheslav2015-07-02 19:17:08
Java
Vyacheslav, 2015-07-02 19:17:08

Where does memory go in a Java web application?

On the server, I launched a web application in Java and Tomcat with a connection to MySQL. To limit memory, set the following options:

-d64 -server -Xss128k -Xms16M -Xmx32M -XX:PermSize=32M -XX:MaxPermSize=48M -XX:ReservedCodeCacheSize=16M -XX:+UseCompressedOops

According to my expectations, the application should occupy 104MB of memory (taking into account 64 threads, actually less).
But after starting the java process takes about 200MB (judging by the RES field of the top utility). After a few hours of doing nothing, the application already occupies more than 300MB (judging by the same top'u).
Actually, the question is: what are these 200 MB of memory spent on and can they be somehow limited by Java tools?
On the Tomcat statistics page, there are statistics on memory, but only those areas of memory that I already know about and which have already been successfully limited are reflected there. In the article habrahabr.ru/post/117274there is a Misc memory area on the diagram, which takes up quite a lot of space, but the article itself does not say what is included in this memory area and I could not find it myself, so I ask for help here.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
cthulhudx, 2015-07-02
@cthulhudx

Try to figure out the cause of the memory leak using the standard jhat utility.
Java Heap Analysis Tool

N
Nikolai, 2015-07-03
@j_wayne

Or VisualVM . Also standard

A
Alexey Pomogaev, 2015-07-08
@Foror

What version of JVM? Try another collector like -XX:+UseG1GC

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question