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: Chris Gray
Subject: Re: Memory leak in java.lang.Thread ?
Date: Thu, 9 Dec 2004 01:48:00 +0100
User-agent: KMail/1.5.4

On Wednesday 08 December 2004 16:05, Archie Cobbs wrote:

> By the way this is a real problem e.g. in an application where
> you create a thread and then decide to start it later (or not)
> based on some last minute information.

One of of Sun's own APIs contains most of the right ingredients: 
Runtime.addShutdownHook() takes an initialised, but unstarted, Thread as 
parameter. Its complement, Runtime.removeShutdoenHook() has memory leak 
written all over it.

Cheers

Chris

-- 
Chris Gray                      /k/ Embedded Java Solutions
Embedded & Mobile Java, OSGi        http://www.kiffer.be/k/
address@hidden                         +32 3 216 0369

Visit us at Embedded World 2005 <http://www.embedded-world.de/>
22--24 Feb. 2005 at the Nürnberg Messe (Germany), booth 10-133





reply via email to

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