lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <rcm...@gmail.com>
Subject Re: Who's cleaning the Fieldcache?
Date Wed, 14 Aug 2013 21:40:10 GMT
On Wed, Aug 14, 2013 at 5:29 PM, Chris Hostetter
<hossman_lucene@fucit.org> wrote:
>
> : why? Those are my sort fields and they are occupying a lot of space (doubled
> : in this case but I see that sometimes I have three or four "old" segment
> : references)
> :
> : Is there something I can do to remove those old references? I tried to reload
> : the core and it seems the old references are discarded (i.e. garbage
> : collected) but I believe is not a good workaround, I would avoid to reload the
> : core for every replication cycle.
>
> You don't need to reload the core to get rid of the old FieldCaches -- in
> fact, there is nothing about reloading the core that will garuntee old
> FieldCaches get removed.
>
> FieldCaches are managed using a WeakHashMap - so once the IndexReader's
> associated with those FieldCaches are no logner used, they will be garbage
> collected when and if the JVMs garbage collector get arround to it.
>
> if they sit arround after you are done with them, they might look like the
> ytake upa log of memory, but that just means your JVM Heap has that memory
> to spare and hasn't needed to clean them up yet.

I don't think this is correct.

When you register an entry in the fieldcache, it registers event
listeners on the segment's core so that when its close()d, any entries
are purged rather than waiting on GC.

See FieldCacheImpl.java

Mime
View raw message