lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve McKay <shubalub...@gmail.com>
Subject Re: Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
Date Wed, 19 Sep 2012 20:00:26 GMT
You're running out of memory. There are two ways to deal with that: give the JVM more heap,
or use less heap. Are you sure your code is being affected by the NetBeans settings? It looks
like they're used for NetBeans' own JVM so it's not going to change anything unless your code
is running in-process with NetBeans.

Other than that, you can reduce heap usage. Make sure you aren't retaining object references
longer than you need to, and tell the JVM to dump heap on OOME. Then you can look at the dump
and see what's eating up your heap.

On Sep 19, 2012, at 1:44 PM, Reyna Melara <reynamelara@gmail.com> wrote:

> Hi, I'm trying to index a big set of plain text files, almost 8,104,467
> files, that are all under the same
> directory /media/MAFALDA/yohasebewp2txt/Archivos and want to get my index
> under /media/MAFALDA/LuceneIndex using IndexFiles.java program from the
> documentation.
> 
> I'm using Netbeans IDE, and I get the folllowing error message:
> 
> Indexing to directory '/media/MAFALDA/LuceneIndex'...
> Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit
> exceeded
> at java.nio.ByteBuffer.wrap(ByteBuffer.java:367)
> at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:155)
> at java.lang.StringCoding.decode(StringCoding.java:191)
> at java.lang.String.<init>(String.java:451)
> at java.lang.String.<init>(String.java:523)
> at java.io.UnixFileSystem.list(Native Method)
> at java.io.File.list(File.java:990)
> at lucenetest.IndexFiles.indexDocs(IndexFiles.java:159)
> at lucenetest.IndexFiles.main(IndexFiles.java:118)
> Java Result: 1
> BUILD SUCCESSFUL (total time: 1 minute 23 seconds)
> 
> 
> I've googled the Exception and also I've found that I must increase the
> maximum memory allocation of the JVM in the user netbeans.conf file under
> the user directory of netbeans: /usr/local/netbeans-7.1.2/etc
> 
> I've already done that but I can make it work.
> 
> I'm pasting the netbeans.conf file content:
> 
> # ${HOME} will be replaced by JVM user.home system property
> netbeans_default_userdir="${HOME}/.netbeans/7.1.2"
> 
> # Options used by NetBeans launcher by default, can be overridden by
> explicit
> # command line switches:
> netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=512m
> -J-Xmx3g -J-Dapple.laf.useScreenMenuBar=true
> -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true
> -J-Dsun.zip.disableMemoryMapping=true -J-XX:+UseConcMarkSweepGC
> -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled"
> # Note that default -Xmx and -XX:MaxPermSize are selected for you
> automatically.
> # You can find these values in var/log/messages.log file in your userdir.
> # The automatically selected value can be overridden by specifying -J-Xmx or
> # -J-XX:MaxPermSize= here or on the command line.
> 
> # If you specify the heap size (-Xmx) explicitly, you may also want to
> enable
> # Concurrent Mark & Sweep garbage collector. In such case add the following
> # options to the netbeans_default_options:
> # -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled
> -J-XX:+CMSPermGenSweepingEnabled
> # (see http://wiki.netbeans.org/FaqGCPauses)
> 
> # Default location of JDK, can be overridden by using --jdkhome <dir>:
> netbeans_jdkhome="/usr/lib/jvm/java-6-openjdk-amd64"
> 
> # Additional module clusters, using ${path.separator} (';' on Windows or
> ':' on Unix):
> #netbeans_extraclusters="/absolute/path/to/cluster1:/absolute/path/to/cluster2"
> 
> # If you have some problems with detect of proxy settings, you may want to
> enable
> # detect the proxy settings provided by JDK5 or higher.
> # In such case add -J-Djava.net.useSystemProxies=true to the
> netbeans_default_options.
> 
> 
> -- 
> Reyna
> Mexico


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message