Hi forum
I'm using YourKit to analyze a Tomcat Web application that seems to leak memory over time. But I'm not quite sure weather it's a leak or something else.
Memory shown for the process in the Windows Task Manager keeps growing. Looking at the process in YourKit tells a different story. In YourKit "all pools" also keeps growing but the rest om the different types seem constant (after GC). Also if make two memory snapshots they show no leaked objects.
Thx,
Rune
Allocated memory vs. used memory
-
- Posts: 3
- Joined: Tue May 23, 2017 8:06 pm
Re: Allocated memory vs. used memory
PS. For some reason the entire image doesn't show. Here's a link: http://rdfined.fastmail.fm/diverse/yourkit.png
PPS. I guess some of the answer lies in this post's reply:
viewtopic.php?f=3&t=3903
https://stackoverflow.com/questions/126 ... ol-divided
But even after many hours of idling the allocated memory isn't released:
http://rdfined.fastmail.fm/diverse/yourkit2.png
PPS. I guess some of the answer lies in this post's reply:
viewtopic.php?f=3&t=3903
https://stackoverflow.com/questions/126 ... ol-divided
But even after many hours of idling the allocated memory isn't released:
http://rdfined.fastmail.fm/diverse/yourkit2.png
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Allocated memory vs. used memory
Hello Rune
If you don't see any leaked objects between snapshots then you don't have any Java-side leaks, i.e. leaks in the Java heap.
However, a JVM process uses memory outside the Java heap too, for its internal structures. Perhaps this is how Java manages its memory allocation.
Is the observed memory growth infinite? For how long does the JVM process run?
Also, a leak may be caused by a native library allocating memory outside the heap. Do you know whether your application uses any?
Please also note that you monitor physical memory in Windows Task Manager. Switch to "Details" tab and make "Commit size" column which corresponds to virtual memory visible (right click the table title and select columns). Do you see that virtual memory grows as well?
Best regards,
Anton
If you don't see any leaked objects between snapshots then you don't have any Java-side leaks, i.e. leaks in the Java heap.
However, a JVM process uses memory outside the Java heap too, for its internal structures. Perhaps this is how Java manages its memory allocation.
Is the observed memory growth infinite? For how long does the JVM process run?
Also, a leak may be caused by a native library allocating memory outside the heap. Do you know whether your application uses any?
Please also note that you monitor physical memory in Windows Task Manager. Switch to "Details" tab and make "Commit size" column which corresponds to virtual memory visible (right click the table title and select columns). Do you see that virtual memory grows as well?
Best regards,
Anton
-
- Posts: 3
- Joined: Tue May 23, 2017 8:06 pm
Re: Allocated memory vs. used memory
Hi Anton
Thank you for the reply. As far as I can tell from the yourkit memory graphs the both heap and non heap memory usage is constant:
http://rdfined.fastmail.fm/diverse/YourKit3.png
http://rdfined.fastmail.fm/diverse/YourKit4.png
But the numbers don't add up. The task manager still shows a higher memory usage (and growing).
My application shouldn't use any native libraries as far as I know (it's a web application running in a Tomcat 8.5 container).
The memory continues to grow.
/Rune
Thank you for the reply. As far as I can tell from the yourkit memory graphs the both heap and non heap memory usage is constant:
http://rdfined.fastmail.fm/diverse/YourKit3.png
http://rdfined.fastmail.fm/diverse/YourKit4.png
But the numbers don't add up. The task manager still shows a higher memory usage (and growing).
My application shouldn't use any native libraries as far as I know (it's a web application running in a Tomcat 8.5 container).
The memory continues to grow.
/Rune
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Allocated memory vs. used memory
Hi Rune
Task Manager shows total process memory usage. Java heap and non-heap are only part of it.
If the process memory grows but heaps don't, something happens outside the heaps. This may be JVMs memory usage, native library memory usage or even agent's memory usage.
Is the observed memory growth infinite? For how long does the JVM process run?
Anyway, could you please provide:
1. The profiler agent log file ~/.yjp/log/<session name>-<pid>.log
2. A performance snapshot of the application (.snapshot file).
You may zip them and send attached to [email protected]
Best regards,
Anton
Task Manager shows total process memory usage. Java heap and non-heap are only part of it.
If the process memory grows but heaps don't, something happens outside the heaps. This may be JVMs memory usage, native library memory usage or even agent's memory usage.
Is the observed memory growth infinite? For how long does the JVM process run?
Anyway, could you please provide:
1. The profiler agent log file ~/.yjp/log/<session name>-<pid>.log
2. A performance snapshot of the application (.snapshot file).
You may zip them and send attached to [email protected]
Best regards,
Anton