Results 1 to 7 of 7
- 06-01-2010, 10:24 AM #1
Member
- Join Date
- Jun 2010
- Posts
- 7
- Rep Power
- 0
Idle Java Application - Memory Leak? (JCONSOLE)
Hi, can someone help me. I have a j2ee web application. I want to monitor if it has a memory leak. I have a tomcat server that has only 1 deployed application I want to monitor. I ran the tomcat server last night and then run jconsole to monitor the memory usage of the application. After running the server, I didn't access the application. I left the server and the jconsole overnight in idle mode. This morning I saw that the memory usage of my application increases through time even if it is idle (no one accessing) See image below for the memory chart. I also force Garbage Collection in JConsole on the last part that's why memory went down on the last part of the chart. My question is does the memory chart say I have a memory leak in my application? But if I have a memory leak, why is it that after I perform GC the memory went down to normal. Any explanation or help will be appreciated. THanks
- 06-01-2010, 10:31 AM #2
Member
- Join Date
- Jun 2010
- Posts
- 7
- Rep Power
- 0
I attached another image below showing same application but I used/accessed the application during some time. In the chart below, I can see that from 1150-1250 I have again increasing memory usage. During this time, I didn't access the application but at 1251 onwards I access the application and the memory went back to normal again. Why is it that only during idle time of my application does the memory increase? Is it a problem in my application or the garbage collector? Thanks.
- 06-01-2010, 10:51 AM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
If your application is hooked up to the (inter)net there will always be some activity (e.g. Google might have visited you). If you don't run out of memory there's nothing to worry about; the garbage collector can handle it. Especially the fact that memory consumption goes back to normal after a while is a good sign ...
kind regards,
Jos
- 06-01-2010, 03:53 PM #4
Member
- Join Date
- Jun 2010
- Posts
- 7
- Rep Power
- 0
Yes, it's connected to the internet. I'll try to test it again without connection but may I ask, is it possible that a memory leak in my application cause this increase in memory usage even if it's in IDLE? I'm testing my application because an outOfMemory Java Heap space error occured in production and I'm now testing if it has a memory leak. I'm first trying to see if it has mem leak in JConsole before using any profiling tool. Any tool or techniques suggestions for memory leak detection will be greatly appreciated. Thanks.
- 06-01-2010, 04:03 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
Yes it is possible that a memory leak occurs somewhere: think of listeners, still linked to some event producers while they are not needed anymore. You can also try to increase the maximum heap size (type "java -X" and look for the -Xmx flag). But the fact that a simple forced garbage collection brings down the memory use to a previous (lower) level is an indication that there is no leak ...
kind regards,
Jos
- 06-03-2010, 12:10 PM #6
Member
- Join Date
- Jun 2010
- Posts
- 7
- Rep Power
- 0
Hi again, I have tested my application and again monitored its mem usage. Now, I accessed and processed transaction with my application. I processed about 20+ transactions and ran my application for about 5 hours. I think the app has a memory leak somewhere but I can't locate it. I used the YourKit Java Profiler tool to profile my app but I'm new to this and can't seem to find the leak. I don't know if traced the code correctly but I traced it to JAXBUtil and I don't know what to do especially that I didn't right the code for the JAXBUtil. I provided screenshots for the JAXBUtil, I hope someone can help me.. Thanks.



- 06-12-2010, 09:00 AM #7
Member
- Join Date
- Jun 2010
- Posts
- 7
- Rep Power
- 0
Similar Threads
-
Memory Leak questions, code review
By mensaFool in forum Advanced JavaReplies: 9Last Post: 03-08-2010, 04:27 PM -
Out of memory work around for a java application (please help!)
By javameanslife in forum Advanced JavaReplies: 9Last Post: 02-02-2010, 01:52 PM -
Help I have a memory leak...
By cdman52 in forum Java AppletsReplies: 10Last Post: 09-28-2009, 10:37 PM -
java.util.logging.StreamHandler memory leak?
By toadaly in forum Advanced JavaReplies: 1Last Post: 02-23-2009, 02:46 PM -
Memory Leak using a Swing Application Project
By iimasd in forum AWT / SwingReplies: 0Last Post: 11-27-2007, 10:20 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks