On 3/14/2013 3:35 AM, Arkadi Colson wrote:
Hi

I'm getting this error after a few hours of filling solr with documents.
Tomcat is running with -Xms1024m -Xmx4096m.
Total memory of host is 12GB. Softcommits are done every second and hard
commits every minute.
Any idea why this is happening and how to avoid this?


*top*
   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+ COMMAND
13666 root      20   0 86.8g 4.7g 248m S  101 39.7 478:37.45
/usr/bin/java
-Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties 
-server
-Xms1024m -Xmx4096m -XX:PermSize=64m -XX:MaxPermSize=128m
-Duser.timezone=UTC -Dfile.encoding=UTF8 -Dsolr.solr.home=/opt/solr/
-Dport=8983 -Dcollection.configName
22247 root      20   0 2430m 409m 4176 S    0  3.4   1:23.43 java
-Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp
/opt/zookeeper/bin/../build/classes:/opt/zookeeper/bin/../build/lib/*.jar:/opt/zookeeper/bi



*free -m**
*             total       used       free     shared buffers     cached
Mem:         12047      11942        105          0        180 6363
-/+ buffers/cache:       5399       6648
Swap:          956         75        881

As you've already been told, this looks like you have about 80GB of index. I ran into Out Of Memory problems with heavy indexing with a 4GB heap on a total index size just a little bit smaller than this. I had to increase the heap size to 8GB.

With heap sizes this large, you'll see garbage collection pause problems without careful tuning. You're probably already having these problems with the 4GB heap, but they'll get much worse with an 8GB heap. Here are the memory options I'm using that got rid of my GC pause problem. I'm using these with with the Sun/Oracle JVM, on both 1.6 and 1.7:

-Xmx8192M -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:NewRatio=3 -XX:MaxTenuringThreshold=8 -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:+UseLargePages -XX:+AggressiveOpts

I notice that you've got options that change the PermSize and MaxPermSize. You probably don't need these options, unless you know that you'll run into problems without it.

Additional note: if you have greatly increased RamBufferSizeMB, try reducing it to 100, the default on recent versions. The default used to be 32. Either amount is usually plenty, unless you have huge documents.

Side comment: 12GB total RAM isn't going to be enough memory for top performance with 80GB of index. You'll probably need 8GB of java heap, plus between 40 and 80GB of memory for the OS disk cache, to fit a large chunk (or all) of your index into RAM. 48GB would be a good start, 64 to 128GB would be better.

Thanks,
Shawn

Reply via email to