0

Today I found my app runing by Java 11 in CentOS 7.x use 500MB+ memory, but I configure the XMX is 256MB. This is my startup script:

nohup ${JAVA_HOME}/bin/java -Xmx256M -Xms128M -jar \
  -Xdebug -Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=0.0.0.0:5019 \
  -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/apps/dolphin-post/ \
  ${APP_HOME}/${APP_NAME} >> /dev/null &

Then I dump the memory jmap -dump:format=b,file=./my.dump 24354 and loaded into Memory Analysis Tool. Shows this report:

The class "java.lang.ref.Finalizer", loaded by "<system class loader>", occupies 6,125,536 (11.96%) bytes. The memory is accumulated in one instance of "java.lang.ref.Finalizer" loaded by "<system class loader>".

Keywords
java.lang.ref.Finalizer

I have no idea where is going wrong. what should I do to find out the problem? In my app, I have not implement the Finalizer by myself.

Dolphin
  • 29,069
  • 61
  • 260
  • 539
  • I read the question, but after that I still do not know how to find the problem and fix it. I am try to figure out where is going wrong. – Dolphin Jul 25 '21 at 16:21
  • Max memory = [-Xmx] + number_of_threads * [-Xss], try using jvisualvm - http://docs.oracle.com/javase/6/docs/technotes/tools/share/jvisualvm.html. – Ramesh Kotha Jul 25 '21 at 16:30

0 Answers0