FAQ
Hello,

*Sample code:*
SpellChecker spell;
RAMDirectory dram = new RAMDirectory();
Dicionario dic = new Dicionario(); //one implementation of spell.Dictionary
spell= new SpellChecker(dram);
spell.indexDictionary(dic); //indexing...

*Then I got the:*
machine1: Windows XP SP2, Celerom 2.66GHz e 256MB
word: 60.000 (40~53 caracteres cada)
memory alloc: 16 (MB)
time to index: 55108 (ms)

So* I tried with 120.000 words* ... when I run the program ...

*Exception in thread "Thread-1"
org.apache.lucene.index.MergePolicy$MergeExceptio
n: java.lang.OutOfMemoryError: Java heap space
at
org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(Conc
urrentMergeScheduler.java:271)
Caused by: java.lang.OutOfMemoryError: Java heap space
at org.apache.lucene.store.RAMFile.newBuffer(RAMFile.java:88)
at org.apache.lucene.store.RAMFile.addBuffer(RAMFile.java:61)
at
org.apache.lucene.store.RAMOutputStream.switchCurrentBuffer(RAMOutput
Stream.java:128)
at
org.apache.lucene.store.RAMOutputStream.writeByte(RAMOutputStream.jav
a:105)
...

*Why this occors?*
*

Search Discussions

  • Erick Erickson at Apr 10, 2008 at 8:22 pm
    If tye 16M means you're only giving the process that much memory, it
    surprises
    me that it runs at all. Especially since you're putting it all in a RAMdir.

    Or is that 16M referring to something else?

    Best
    Erick
    On Thu, Apr 10, 2008 at 2:42 PM, Leandro wrote:

    Hello,

    *Sample code:*
    SpellChecker spell;
    RAMDirectory dram = new RAMDirectory();
    Dicionario dic = new Dicionario(); //one implementation of
    spell.Dictionary
    spell= new SpellChecker(dram);
    spell.indexDictionary(dic); //indexing...

    *Then I got the:*
    machine1: Windows XP SP2, Celerom 2.66GHz e 256MB
    word: 60.000 (40~53 caracteres cada)
    memory alloc: 16 (MB)
    time to index: 55108 (ms)

    So* I tried with 120.000 words* ... when I run the program ...

    *Exception in thread "Thread-1"
    org.apache.lucene.index.MergePolicy$MergeExceptio
    n: java.lang.OutOfMemoryError: Java heap space
    at
    org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(Conc
    urrentMergeScheduler.java:271)
    Caused by: java.lang.OutOfMemoryError: Java heap space
    at org.apache.lucene.store.RAMFile.newBuffer(RAMFile.java:88)
    at org.apache.lucene.store.RAMFile.addBuffer(RAMFile.java:61)
    at
    org.apache.lucene.store.RAMOutputStream.switchCurrentBuffer(RAMOutput
    Stream.java:128)
    at
    org.apache.lucene.store.RAMOutputStream.writeByte(RAMOutputStream.jav
    a:105)
    ...

    *Why this occors?*
    *
  • Leandro at Apr 10, 2008 at 8:36 pm

    If tye 16M means you're only giving the process that much memory, it
    surprises
    me that it runs at all. Especially since you're putting it all in a
    RAMdir.
    Sorry that 16M is dictonarySizeInBytes() I would imagine that it is the same
    size of index...

    Well when I start to use a Dictonary with more than 60.000 need I to use
    FSDirectory?


    Or is that 16M referring to something else?

    Just Dictonary size...
    :(

    Best
    Erick
  • Toke Eskildsen at Apr 11, 2008 at 6:33 am

    On Thu, 2008-04-10 at 15:42 -0300, Leandro wrote:
    machine1: Windows XP SP2, Celerom 2.66GHz e 256MB
    If that is a physical machine (as opposed to virtual), then the amount
    of RAM if not at all well balanced against the processor speed.
    [...] java.lang.OutOfMemoryError: Java heap space
    How much memory do you allocate for the whole JVM? If you're not sure,
    then you're probably using the default, which is probably 64MB for your
    machine. If so, you can try allocating more memory for the JVM:
    java -Xmx=128m -jar LeandroApplication.jar


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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedApr 10, '08 at 6:43p
activeApr 11, '08 at 6:33a
posts4
users3
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase