MaxPermSize is a not-always-documented jvm flag similar to Xmx. You set it like this...
java -Xmx200M -XX:MaxPermSize=100m Myclass It sets the maximum amount of space that will be available to the jvm for 'permanent' things (classes, etc.) and defaults to just 64MB. This can often run out with code that generates lots of classes as it goes along (e.g. all those proxies in jboss, something similar in big xdoclet tasks). One important thing is how it relates to Xmx - whereas garbage collector limits (for the young and old parts of ram) are within the overall limit set by Xmx, Max Perm Size is separate from Xmx. This means you could chuck gigabytes of ram at your Xmx and still get something a bit like an out of memory error by using up the default 64mb limit for class definitions. Here's some web pages that refer with more detail.... http://www.tagtraum.com/gcviewer-vmflags.html http://java.sun.com/docs/hotspot/gc/ http://www.unixville.com/~moazam/stories/2004/05/17/maxpermsizeAndHowItRelatesToTheOverallHeap.html hth Dan -----Original Message----- From: Dan Gould [mailto:[EMAIL PROTECTED] Sent: 09 December 2005 01:49 To: java-user@lucene.apache.org Subject: JVM Crash in Lucene Hi-- I'm relatively new to Lucene. When I run my app, I get a JVM error. This gets called a lot, but only fails every once in awhile (maybe 1 in 100 calls?) I filed a report with Sun, but I don't expect to hear anything from them. So, I was wondering if any Lucene experts have run across this or have any ideas for workarounds (if not, I'll have to take lucene out of my system and manage the termvectors myself): # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x0000002a95a5c300, pid=26545, tid=1085655392 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_06-b05 mixed mode) # Problematic frame: # V [libjvm.so+0x4fa300] # # An error report file with more information is saved as hs_err_pid26545.log That error file is huge, but the salient part seems to be: Stack: [0x0000000040a5c000,0x0000000040b5d000), sp=0x0000000040b59f70, free sp ace=1015k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x4fa300] V [libjvm.so+0x4fa3c2] V [libjvm.so+0x4fa876] V [libjvm.so+0x58051e] V [libjvm.so+0x58017c] V [libjvm.so+0x2b968b] V [libjvm.so+0x2b67ba] V [libjvm.so+0x25f3c7] V [libjvm.so+0x2bed06] V [libjvm.so+0x2be6b2] V [libjvm.so+0x6163f9] V [libjvm.so+0x610ffe] V [libjvm.so+0x554745] Current CompileTask: opto:1621 org.apache.lucene.index.IndexReader$1.doBody()Ljava/lang/Object; (99 bytes) My code that is causing the JVM crash is: //Get the terms and frequencies IndexReader indexreader = null; TermFreqVector tv = null; try { indexreader = indexManager.getIndexReader(); tv = indexManager.getTermVector(indexreader, item); if(null==tv) { if(log.isErrorEnabled()) log.error("No term vector for item " + item.getId()); //??? better handling return; } } finally { //XXX should close earlier if(null!=indexreader) { try { indexreader.close(); } catch(IOException ex) { if(log.isDebugEnabled()) log.debug("IOException cleaning up indexreader ", ex); } } } //Replace the String[] with its equivalent long[]... (and tally up total occurs) String[] termstrings = tv.getTerms(); int[] freqs = tv.getTermFrequencies(); Thank you for your help, Dan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]