Skip to main content

Memory increase until window minimized

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
java_dude
Offline
Joined: 2011-01-10

Hi guys!
I have developed a java swing application loggin serial com port messages. It starts and runs fine for a couple of days, but hangs after some time. After some research the com port handling does not seem te be the problem.
I checked the memory usage and it seems that memory increases slowly but steadily. My application makes intensive use of the interface (swing) since it logs messsages every second or less. The strange thing is that when I (literally) minimize the program (in windows) the memory use drops to 20MB to go up fast to 70MB and then increase slowly (between 20k and 100k a second) This seems to go on indefinatly (i have waited several times until it went above 150MB). Then when i maximize the window nothing happens but when i minimize it again the memory cycle restarts: drops to about 20MB then 70MB quikly and then slowly indefinitly.
The VM-size in the task manager stays at 251MB...
My application has to run forever in more or less the background and it crashes after a couple of days. Is this memory issue related to this freezing/hanging?
How can this be solved?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
java_dude
Offline
Joined: 2011-01-10

SOLVED!
Memory leak was due to unclosed database statements.