ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey N. Solofnenko" <A.Solofne...@mdl.com>
Subject Re: Out of memory errors since recent changes.
Date Fri, 14 Jan 2005 01:20:23 GMT
Implementation seems strange. Usually thread local objects are used as 
following:

private static ThreadLocal threadLocalProperties=new 
InheritableThreadLocal(); // notice "static" there

public static ThreadLocalProperties getLocalProperties() { // static too
  ThreadLocalProperties 
properties=(ThreadLocalProperties)threadLocalProperties.get();
  if (properties==null) threadLocalProperties.set(properties=new 
ThreadLocalProperties());
  return properties;
}

Are you sure the current implementation works?

- Alexey.

Matt Benson wrote:

>You said they are created via the ITL get()?  So does
>it look like there are lots of Threads but when they
>did their ITLs instances aren't getting cleaned up? Or
>does it rather look like we are creating more
>LocalPropertyStacks than necessary?
>
>-Matt
>
>--- Martijn Kruithof <jm@kruithof.xs4all.nl> wrote:
>
>  
>
>>I can see from traces I added to the code that
>>thousands of 
>>LocalPropertyStacks
>>are created via the |InheritableThreadLocal|,
>>    
>>
>[snip]
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message