[ https://issues.apache.org/jira/browse/LUCENE-4698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13743248#comment-13743248 ]
David Smiley commented on LUCENE-4698: -------------------------------------- Bill; if you don't use the field in a manner that would trigger the use of the ShapeFieldCache (i.e. you simply use the field for filtering) then you needn't worry about it. If you've got one value per field then use LatLonType in Solr. If you have more than one value (or even if you have one), then SOLR-5170 works great. The classes in that patch don't modify Solr so you can package them into a jar without having to actually patch Solr. Once a suitable alternative exists, I'll remove the ShapeFieldCache. > Overhaul ShapeFieldCache because its a memory pig > ------------------------------------------------- > > Key: LUCENE-4698 > URL: https://issues.apache.org/jira/browse/LUCENE-4698 > Project: Lucene - Core > Issue Type: Improvement > Components: modules/spatial > Reporter: David Smiley > Attachments: solr_spatial_leak1.png > > > The org.apache.lucene.spatial.util.ShapeFieldCache* classes together > implement a spatial field cache for points, similar to FieldCache for other > fields. It supports a variable number of points per document, and it's > currently only used by the SpatialPrefixTree strategy because that's the only > strategy that supports a variable number of points per document. The other > spatial strategies use the FieldCache. The ShapeFieldCache has problems: > * It's a memory pig. Each point is stored as a Point object, instead of an > array of x & y coordinates. Furthermore, each Point is in an ArrayList that > exists for each Document. It's not done any differently when your spatial > data isn't multi-valued. > * The cache is not per-segment, it's per-IndexReader, thereby making it > un-friendly to NRT search. > * The cache entries don't self-expire optimally to free up memory. The cache > is simply stored in a WeakHashMap<IndexReader,ShapeFieldCache>. The big cache > entries are only freed when the WeakHashMap is used and the JVM realizes the > IndexSearcher instance has been GC'ed. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org