You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by rviper <st...@it-fabrik.at> on 2009/02/27 09:03:58 UTC

ThreadLocal / Memory Problems with Analyzer class

hi,

environment: lucene 2.4, jdk 1.6

i'm using quartz jobs to schedule indexing tasks; currently i'm creating a
new instance of an analyzer each time i open the index; after some time i'm
getting a out of memory;

Analyzer Class:
private ThreadLocal tokenStreams;

since the analyzer class is using a thread local -> should i reuse an
analyzer (e.g singleton pattern) in this case (quartz job reusing threads
(=tread pool) -> thread local data never gets freed)...)?

Mem dump:

Class name                                                                                
| Shallow Heap | Retained Heap | Percentage 
--------------------------------------------------------------------------------------------------------------------------------------
org.quartz.simpl.SimpleThreadPool$WorkerThread @ 0xb4e8070 
QuartzScheduler_Worker-3 Thread|          120 |    55.914.144 |     21,65% 
|- java.lang.ThreadLocal$ThreadLocalMap @ 0xdf32a20                                       
|           24 |    55.913.760 |     21,65% 
|  '- java.lang.ThreadLocal$ThreadLocalMap$Entry[16384] @ 0x163a61b8                      
|       65.552 |    55.913.736 |     21,65% 
|     |- java.lang.ThreadLocal$ThreadLocalMap$Entry @ 0xe090ca8                           
|           32 |         9.608 |      0,00% 
|     |  |- org.apache.lucene.analysis.StopAnalyzer$SavedStreams @ 0xe090cc8              
|           24 |         9.560 |      0,00% 
|     |  |  |- org.apache.lucene.analysis.LowerCaseTokenizer @ 0xe090ce0                  
|           32 |         8.520 |      0,00% 
......
......

thanks

-- 
View this message in context: http://www.nabble.com/ThreadLocal---Memory-Problems-with-Analyzer-class-tp22241132p22241132.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Re: ThreadLocal / Memory Problems with Analyzer class

Posted by rviper <st...@it-fabrik.at>.
ok, also see https://issues.apache.org/jira/browse/LUCENE-1186


-- 
View this message in context: http://www.nabble.com/ThreadLocal---Memory-Problems-with-Analyzer-class-tp22241132p22241327.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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