Profile Image
Pramod

what might be causing this memory retention?

Hi,

With my application running (on Jboss 7.2) for more than 23 hours, I could observe that the tests are complete. However, post completion, the memory is still retained and is not being reduced. 

Initially during the start of my test, it was 6.25GB and post 23 hours, the memory is 6.71GB. Ideally, it should have been reduced to < 6.25GB (ideally to the lowest value) as there is no other application running.

 

Can somebody please explain what might be causing this memory retention? 


 

Below are my JVM settings - 

 

JAVA_OPTS="-Xms8024m -Xmx8024m -XX:MaxPermSize=1024m -XX:+UseG1GC -XX:+UseStringDeduplication -Djava.net.preferIPv4Stack=true"

 

Report URL - https://gceasy.io/my-gc-report.jsp?p=c2hhcmVkLzIwMjEvMDkvMzAvLS1nYy5sb2cuMC5jdXJyZW50LS0xNy0zNS0zOA==&channel=WEB

  • memory

  • retention

  • memoryretentionissue

  • jvmsettings

  • jvmarguments

  • memoryusage

  • gclogs

Please Sign In or to post your comment or answer

Profile Image

Ram Lakshmanan

Hello Pramod!

 Greetings. It's not clear to me, why you are saying that your memory size is at 6.71GB after test completion. From where you are getting that number.

 

 Below is the heap usage graph from your report. You can notice that heap usage is around 1.7GB towards the end.

 

Profile Image

Pramod

Hi Ram,

 

Thank you for your reply. The above numbers are from Dynatrace.

Below screenshot for your reference.

 

Profile Image

Pramod

Also, below are my JVM settings 

 

JAVA_OPTS="-Xms8024m -Xmx8024m -XX:MaxPermSize=1024m -XX:+UseG1GC -XX:+UseStringDeduplication -Djava.net.preferIPv4Stack=true"

Profile Image

Pramod

Hi Ram,

Thank you for your reply. The above numbers are from Dynatrace.

Below screenshot for your reference.

 

Profile Image

Ram Lakshmanan

Hello Parmod!

 

 In your JVM arguments you have configured "-Xms8024m -Xmx8024m". It means your initial heap size and max heap size are set to ~8GB. Thus your overall Java process will be allocated 8GB space from the operating system, irrespective of what your JVM uses . However internally all that 8GB will not be used (as pointed in your GC log file). It's clear from your GC log your application is using only in tune of ~1.7GB after Garbage collection. I will go with GC Log reporting (which is more accurate) than Dynatrace reporting.

 

 Here is a short video clip which might give little bit more insights to JVM memory.

Profile Image

Pramod

Thanks Ram for your inputs. My only concern now is why the memory is retained even after there is no activity happening. I am assuming the old gen is retaining some objects, which we may want to clear after some point of time. Can this be configured using any additional memory parameters? Or any other params addition would result in better memory usage? Please suggest.

TIA.

Profile Image

Ram Lakshmanan

Hello Parmod!

Fig: Heap usage before Garbage Collection

Fig: Heap usage after Garbage collection

 Above are the excerpts from your GC report. If you notice heap size was around 4.5GB before GC and after GC it's dropping around 1.75GB. This is indicating memory is getting dropped.

You might wonder why we are still seeing this 1.75GB worth of objects in memory when there is no activity in the application. It's good question. I am fairly certain, this 1.75GB of objects are basically your application cache and long lived objects. Your application might be caching caching objects for better performance.

Profile Image

Pramod

Thanks a lot Ram for your explanation. Yes as you said, the retention is due to the compiled objects and cached objects present in the old gen.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • memory

  • retention

  • memoryretentionissue

  • jvmsettings

  • jvmarguments

  • memoryusage

  • gclogs