Skip to content

Apache Lucene open-source search software

Since many fields are single valued, start the ArrayList with capacity 1 -- this should help with GC.

Ryan McKinley6ed8e171ada9
diff --git a/src/java/org/apache/solr/common/SolrDocument.java b/src/java/org/apache/solr/common/SolrDocument.java
index e063d3d6145..813af1dba56 100644
--- a/src/java/org/apache/solr/common/SolrDocument.java
+++ b/src/java/org/apache/solr/common/SolrDocument.java
@@ -51,7 +51,7 @@ public class SolrDocument
*/
protected Collection<Object> getEmptyCollection( String name )
{
- return new ArrayList<Object>();
+ return new ArrayList<Object>( 1 );
}
/**