classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory leak in java.lang.Thread ?


From: Archie Cobbs
Subject: Re: Memory leak in java.lang.Thread ?
Date: Tue, 07 Dec 2004 20:27:52 -0600
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041129

Archie Cobbs wrote:
What happens when you run this program:

    public class ThreadLeak {
        public static void main(String[] args) {
            while (true)
                new Thread();
        }
    }

I get an OutOfMemoryError.

Now I realize that Sun's JDK has the same bug:

  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4410846

Can we fix this simply by having the references from the
ThreadGroup -> Thread be via weak references?

I'm not sure why Sun hasn't done that already.

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]