You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by rm...@cheapcomplexdevices.com on 2006/03/23 01:34:03 UTC

SEVERE: java.lang.OutOfMemoryError: Java heap space

Occasionally when inserting I get the error message
  SEVERE: java.lang.OutOfMemoryError: Java heap space
Any clues how to track down when&where it's happening?
Or any good way I can get better clues how to track it down?

I'm doing inserts of about 1000 documents at a time between
commits.  Would doing a smaller number avoid this problem.
Or, better - any way I can calculate how many docs I can
insert in a batch without triggering this?

Re: SEVERE: java.lang.OutOfMemoryError: Java heap space

Posted by Yonik Seeley <ys...@gmail.com>.
On 3/22/06, rm_solr@cheapcomplexdevices.com
<rm...@cheapcomplexdevices.com> wrote:
>
> Occasionally when inserting I get the error message
>   SEVERE: java.lang.OutOfMemoryError: Java heap space
> Any clues how to track down when&where it's happening?
> Or any good way I can get better clues how to track it down?

What's the heap size of the JVM.  The default is normally pretty small.
If you are using the example, just put it on the command line...

java -Xmx256m -jar start.jar

> I'm doing inserts of about 1000 documents at a time between
> commits.  Would doing a smaller number avoid this problem.

No, that shouldn't be a problem.
Solr only keeps a single hashtable entry for each unique id of
uncommitted documents so it can delete duplicates during the commit.

The exception probably hits when lucene needs to merge segments. 
There isn't much you can do to avoid that memory usage except increase
the heap size.
BTW, How many indexed fields do you have?

-Yonik