Home > database >  Why Heap usage increase continuously?
Why Heap usage increase continuously?

Time:11-02

I create API that just return string("OK").

enter image description here


And I test it with following configuration. enter image description here


I monitor it with visualVM, and notice that heap usage increase continuously. Eventually jvm perform gc. enter image description here



Question.

  1. why heap usage increase continuously?

CodePudding user response:

Hello,I guess there is other classes in SpringMVC is created。such as threadlocal

CodePudding user response:

Better than guessing you can actually use jvisualvm to help you find what objects are there in heap by memory sampling. You can see the number of instances of objects and total size in the profiling section as shown in below screenshot. You can take snapshots while your load test runs and you can then later analyze them. You can even take a heap dump and analyze that with tools like enter image description here

  • Related