Click to See Complete Forum and Search --> : Memory Leaks ?


Didier Trosset
February 23rd, 2000, 02:44 AM
I discovered that Java is leaking memory. My program memory was still growing and growing. Serahcing around, I discovered an article in DrDobb's Journal February 2000, p115 Java Q&A. I explained all this very well. See: http://www.ddj.com/articles/2000/0002/0002l/0002l.htm

It explains that Java has "loiters". (Not "leaks" like C++) To solve them, I tried JProbe and OptimizeIt, but I still have some loiters left.

Has anyone already deal with memory problems?
What kind of tools do you use?
Does it take long to solve?
Have you had many such problems?

Thanks
Didier

keithmcelhinnney
March 2nd, 2000, 09:52 AM
I have had to deal with alot of memory leaks and regretfully, I just plowed through the code and found them. The biggest culprit is Images and Graphics. When you are done using an Image you have to call flush() on them. If you use a Graphic you have to call dispose. If you are double buffering yourself, these are probably the majority of leaks. Also, you may want to try calling System.gc() every so often as it will help.

-Keith

keith