Re: String.valueOf() Memory Leak inside of thread.
- From: BLlewellyn@xxxxxxxxx
- Date: 11 Aug 2006 05:07:59 -0700
Thomas Hawtin wrote:
BLlewellyn@xxxxxxxxx wrote:
This is causing a memory leak. If I change the line to read "String
str = "String.valueOf("1"); there is no problem. Also, if I do
something like: String str = "Hello world!"; there is also no problem.
If I use String.valueOf(1); inside the loop but outside of the thread,
there is no problem. Can anyone see why garbage collection is not
occurring inside the thread?
Are you sure you aren't just causing vast numbers of threads to be
running at once? Does shoving in a thread.join() fix it for you?
Tom Hawtin
Tom:
I have tried adding a thread.join() immediately after the
thread.start() method is called. The result is the same - according to
the NetBeans Profiler, none of the strings are being reclaimed. Any
more thoughts?
Thanks!
--Brad
.
- References:
- String.valueOf() Memory Leak inside of thread.
- From: BLlewellyn
- Re: String.valueOf() Memory Leak inside of thread.
- From: Thomas Hawtin
- String.valueOf() Memory Leak inside of thread.
- Prev by Date: Re: Client to telnet into server and then ftp to another server
- Next by Date: Re: JNI EXCEPTION_ACCESS_VIOLATION
- Previous by thread: Re: String.valueOf() Memory Leak inside of thread.
- Next by thread: Re: String.valueOf() Memory Leak inside of thread.
- Index(es):
Relevant Pages
|