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 Paul Taylor <pa...@fastmail.fm> on 2010/09/15 10:56:09 UTC
Use of SimpleStringInterner in non Lucene App
Im currently using String.intern() in my app purely to reduce the memory
usage, this has worked well except the memory required for intern() go
into perm rather than heap, setting perm on different platforms is on
trivial so Im looking for a solution that works on Heap. (Now before you
say tune your applications please understand that my app is memory bound
based on how many files are loaded into it , which can be anything from
10 to 100,000, in the long term I am going to move to a database soln to
solve this issue, but in the short term I need intern() for heap memory)
Does SimpleStringInterner use heap, would it be sensible to use it for a
non lucene stuff, and what do the tableSize and maxChainLength
parameters mean. ?
thanks Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Use of SimpleStringInterner in non Lucene App
Posted by Paul Taylor <pa...@fastmail.fm>.
Paul Taylor wrote:
> Im currently using String.intern() in my app purely to reduce the
> memory usage, this has worked well except the memory required for
> intern() go into perm rather than heap, setting perm on different
> platforms is on trivial so Im looking for a solution that works on
> Heap. (Now before you say tune your applications please understand
> that my app is memory bound based on how many files are loaded into it
> , which can be anything from 10 to 100,000, in the long term I am
> going to move to a database soln to solve this issue, but in the short
> term I need intern() for heap memory)
>
> Does SimpleStringInterner use heap, would it be sensible to use it for
> a non lucene stuff, and what do the tableSize and maxChainLength
> parameters mean. ?
>
> thanks Paul
>
In case of interest to anyone
Having looked at the code it seems Lucene SimpleStringInterner still
uses String.intern() it just has some cpu optimizations to reduce
unneccessary calls to string.intern()
Google have a replacement for String.intern() which I think will do the
job for me
http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/common/collect/Interners.html
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org