[jsword-devel] API Examples OutOfMemory Error

Joe Kumar joekumar at gmail.com
Mon Jan 3 21:41:30 MST 2011


Hi all,

I've been trying out APIExamples.java and initially had issues
with examples.search();
There was no index for the "Book" and so I modified getIndex(Book book)
in LuceneIndexManager to create an index if there was no index

 if (reply == null) {

                URI storage = getStorageArea(book);

                if(isIndexed(book)){

                    reply = new LuceneIndex(book, storage);

                }

                else{

                    reply = new LuceneIndex(book, storage,true);

                }

                INDEXES.put(book, reply);

            }


After this change, examples.search worked fine.

Now examples.rankedSearch(); is failing with an OutOfMemory Error.
Stacktrace is like below


   org.crosswire.jsword.index.lucene.LuceneIndex(INFO):
ParsedQuery-content:for content:god content:so content:loved content:the
content:world

 Exception in thread "main" java.lang.OutOfMemoryError: Requested array size
exceeds VM limit

at org.apache.lucene.util.PriorityQueue.initialize(PriorityQueue.java:105)

at org.apache.lucene.search.HitQueue.<init>(HitQueue.java:67)

at org.apache.lucene.search.TopScoreDocCollector.<init>(
TopScoreDocCollector.java:126)

at org.apache.lucene.search.TopScoreDocCollector.<init>(
TopScoreDocCollector.java:37)

at
org.apache.lucene.search.TopScoreDocCollector$OutOfOrderTopScoreDocCollector.<init>(
TopScoreDocCollector.java:74)

at
org.apache.lucene.search.TopScoreDocCollector$OutOfOrderTopScoreDocCollector.<init>(
TopScoreDocCollector.java:72)

at org.apache.lucene.search.TopScoreDocCollector.create(
TopScoreDocCollector.java:115)

at org.crosswire.jsword.index.lucene.LuceneIndex.find(LuceneIndex.java:263)


I modified the VM args to -Xmx1024m -Xms1024m and still having this issue

Has anyone else faced the same problem. is APIExamples working fine for
everyone ?

I am using Eclipse 3.5 on OSX Snow Leopard.


Any directions would be greatly appreciated.



thanks

Joe.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20110103/8ea05e90/attachment.html>


More information about the jsword-devel mailing list