This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Memory leak with Sockets?
- From: Stanley Brown <stanley dot brown at zimmer dot com>
- To: java at gcc dot gnu dot org
- Date: Thu, 30 Oct 2003 16:14:40 -0500
- Subject: Re: Memory leak with Sockets?
This took a while to find. Problem is that I had to debug a commercial
API to find the leak. I was wrong in assuming it had to do with Sockets
OR the streams. The leak is being caused by the creation of Calender
instances. Heres a fast example:
while (true)
{
<msg00319.html>java.util.Calendar calendar =
java.util.Calendar.getInstance();
}
The garbage collector is unable to reclaim the memory allocated by the
getInstance method. Any ideas on how to fix this problem?