Know what objects got garbage collected

65 views Asked by At

when I look at the memory consumption of my java app I expierience a strange behavior:

The application allocates 500 MB in ~10 Minutes and then the garbage collector frees the 500 MB. Then, 500 MB gets allocated and freed again, and again and again.

There are no users on the application - the application is in stand by.

Can you give me a hint how to detect why the application allocates 500 MB?

Thanks

2

There are 2 answers

0
AdamSkywalker On BEST ANSWER

You can use JVisualVM from your JDK to analyze memory usage.

You should open your application and take a memory dump, you'll see how much memory is allocated by different classes. It can point you to right directions.

0
Margus On

Is this server side or client side application.

You can take a memory dump and look inside. Depending on OS tools can very.

Alternative would be to use JProfiler.