For Programmers: Free Programming Magazines  


Home > Archive > Java Help > October 2006 > Memory leak?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Memory leak?
Knute Johnson

2006-10-23, 4:09 am

I have an application that is slowing down after being run for several
days and then it finally throws an OutOfMemoryException. Until I come
up with a better idea, I'm assuming I have a memory leak. I've gone
through the code pretty well and can't find anything obvious. The only
thing I'm not sure about is some JDialogs. Do I need to dispose them to
make sure that they get garbage collected? There are no dangling
references to them.

I've run JConsole for several hours on the code but nothing shows up.
Any other tools that you can recommend to track down a memory leak?

Thanks,

--

Knute Johnson
email s/nospam/knute/
Lothar Kimmeringer

2006-10-23, 10:04 pm

Knute Johnson wrote:

> I have an application that is slowing down after being run for several
> days and then it finally throws an OutOfMemoryException. Until I come
> up with a better idea, I'm assuming I have a memory leak. I've gone
> through the code pretty well and can't find anything obvious. The only
> thing I'm not sure about is some JDialogs. Do I need to dispose them to
> make sure that they get garbage collected? There are no dangling
> references to them.


The easiest way to find out is using a memory-profiler. There are
a couple of them out there and most of them offer a free trial.


Regards, Lothar
--
Lothar Kimmeringer E-Mail: spamfang@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
Xavier Tarrago

2006-10-24, 4:00 am

Yes, you should dispose JFrame(s) and JDialog(s) to get them gc'ed.

"Lothar Kimmeringer" <news200610@kimmeringer.de> a écrit dans le message de
news: 2j13g6k6zym0$.dlg@kimmeringer.de...
> Knute Johnson wrote:
>
>
> The easiest way to find out is using a memory-profiler. There are
> a couple of them out there and most of them offer a free trial.
>
>
> Regards, Lothar
> --
> Lothar Kimmeringer E-Mail: spamfang@kimmeringer.de
> PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
>
> Always remember: The answer is forty-two, there can only be wrong
> questions!



Knute Johnson

2006-10-30, 7:32 pm

Xavier Tarrago wrote:
> Yes, you should dispose JFrame(s) and JDialog(s) to get them gc'ed.
>
> "Lothar Kimmeringer" <news200610@kimmeringer.de> a écrit dans le message de
> news: 2j13g6k6zym0$.dlg@kimmeringer.de...
>
>


Thanks.

--

Knute Johnson
email s/nospam/knute/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com