lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrzej Bialecki ...@getopt.org>
Subject Re: How to get a stack trace
Date Sat, 08 Aug 2009 12:47:32 GMT
Chris Hostetter wrote:
> : I'm a new user of solr but I have worked a bit with Lucene before. I get 
> : some out of memory exception when optimizing the index through Solr and 
> : I would like to find out why. However, the only message I get on 
> : standard output is: Jul 30, 2009 9:20:22 PM 
> : org.apache.solr.common.SolrException log SEVERE: 
> : java.lang.OutOfMemoryError: Java heap space
> : 
> : Is there a way to get a stack trace for this exception? I had a look 
> : into the java.util.logging options and didn't find anything.
> 
> FWIW #1: OutOfMemoryError is a java "Error" not an "Exception" ... 
> Exceptions and Errors are both Throwable, but an Error is not an 
> Exception. this is a really importatn distinction (see below)
> 
> FWIW #2: when dealing with an OOM, a stack trace is almost never useful.  
> as mentioned in other threads, a heapdump is the most useful diagnostic 
> tool
> 
> FWIW #3: the formatting of Throwables in log files is 100% dependent 
> on the configuration of the log manager -- the client code doing 
> the logging just specifies the Throwable object -- it's up to the 
> Formatter to decide how to output it.
> 
> Ok .. on to the meat of hte issue...
> 
> OOM Errors are a particularly devious class of errors: they don't 
> neccessarily have stack traces (depending on your VM impl, and the state 
> of the VM when it tries to log the OOM) ....
>    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4753347
>    http://blogs.sun.com/alanb/entry/outofmemoryerror_looks_a_bit_better
> 
> ...on any *Exception* you should get a detailed stacktrace in the logs 
> (unless you have a really screwed up LogManger configs), but when dealing 
> with *Errors* like OutOfMemoryError, all bets are off as to what hte VM 
> can give you.

I had some success in debugging this type of problems when I would 
generate a heap dump on OOM (it's a JVM flag) and then use a tool like 
HAT to find largest objects and references to them.


-- 
Best regards,
Andrzej Bialecki     <><
  ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


Mime
View raw message