If CloseableThreadLocal.hardRefs is still a live reference then it
means the SegmentReader hasn't been closed yet, ie I think the chain
you show below is from a still-open SegmentReader?

Is it possible on upgrade to Tomcat 7 that more threads are doing
searches (which will require more RAM since Lucene stores per-thread
state in the CloseableThreadLocals...)?

Mike McCandless

http://blog.mikemccandless.com

On Wed, Jan 2, 2013 at 8:26 AM, Alon Muchnick <a...@datonics.com> wrote:
> Hello All ,
> we are using Lucune 3.6.2 in our web application on tomcat 5.5 and recently
> we started testing our application on tomcat 7, unfortunately we seem to
> encounter a memory link in Lucune's  CloseableThreadLocal class , any help
> with solving the below issue would be much appreciated.
>
>
> we are using RAMDirectory for our Indexes , while testing the application
> on tomcat 7 we noticed that there is a memory leak in our application ,
> after taking a heap dump we can see the memory leak is in the:
>
>
>
> Type |Name                |Value
> ------------------------------------------------------------
> ref |   index                   |  org.apache.lucene.store.RAMDirectory --->
> ------------------------------------------------------------
>
> ------------------------------------------------------------------------
> ref |   core                    |
> org.apache.lucene.index.SegmentReader$CoreReaders   --->
> ------------------------------------------------------------------------
>
> --------------------------------------------------------------
> ref |   tis                       |
> org.apache.lucene.index.TermInfosReader  --->
> --------------------------------------------------------------
>
>
> -----------------------------------------------------------------------------
> ref |   threadResources   |  org.apache.lucene.util.CloseableThreadLocal
> --->
> -----------------------------------------------------------------------------
>
>
> --------------------------------------------
> ref  |   hardRefs              |  java.util.HashMap @ 0x9d566938
> --------------------------------------------
>
> i guess the HashMap is used for caching purposes and it hold entries where
> the key is a thread name and the value is a
> org.apache.lucene.index.TermInfosReader$ThreadResources object .
>
> *even when i stop new incoming connection to the application , tomcat
> closes all the active threads and a GC is run the above map size is not
> reduced and GC cannot reclaim the heap space .
> *
> the problem looks  some what similar to LUCENE-3841
> https://issues.apache.org/jira/browse/LUCENE-3841
> but we are no using SnowballAnalyzer .
>
> ( i checked the code and made sure the hardRefs map is a WeakHashMap )
>
>
> our JVM is :
>
> OpenJDK 64-Bit Server VM ,
> java.runtime.version1.6.0_20-b20
>
>
> one again any help would be much appreciated.
>
> thanks
>
> Alon

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to