java heap size increasing

2019-08-23 07:40发布

问题:

I compile a jar file, and i write to the Log every half a minute to check threads and memory situation.

Attached are the start of the log, and the end of the day log, after this software was stuck, and stop working.

In the middle of the day several automatic operations happened. I received quotes about 40 per seconds, and finished to take care of every one of the quotes before the next came.

Plus, every 4 seconds i write a map with info to the DB.

Any ideas why heap size in increasing? (look at currHeapSize)

morning:

evening:

回答1:

Any ideas why heap size in increasing?

These are classic symptoms of a Java storage leak. Somewhere in your application is a data structure that is accumulating more and more objects, and preventing them from being garbage collected.

The best way to find a problem like this is to use a memory profiler. The Answers to this Question explain.