lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahil <>
Subject OutOfMemory and IOException Access Denied errors
Date Fri, 19 May 2006 12:13:55 GMT

I am new to Lucene so am perhaps missing something obvious. I have included Lucene 1.9.1 in
my classpath and am trying to integrate it with MySQL.

I have a table which has near a million records in it. According to the documentation on Lucene
I have read so far, my understanding is that I need to (1) make a connection with MySQL then
(2) execute the query normally in SQL syntax. (3) Then pass the ResultSet to the method to
create indexes. (4) I can then pass a queryString to the searchIndex() custom method to locate
the queryString. 


(a) The first problem I had was when trying to execute the query on the million records table
in Step 1. It resulted in an OutOfMemory error due to the size of the table. How can I get
around this problem so that the query executes on the entire table at one time? 

As a workaround, I limited the number of results to 100,000 which worked fine.

(b) But I then received an IOException when the index was being written to the Document object.
The Exception stack trace is shown below: 

Exception in thread "main" Access is denied
	at Method)
	at org.apache.lucene.index.IndexWriter.mergeSegments(
	at org.apache.lucene.index.IndexWriter.maybeMergeSegments(
	at org.apache.lucene.index.IndexWriter.addDocument(
	at org.apache.lucene.index.IndexWriter.addDocument(
	at  --- error line in my
piece of code !
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at com.intellij.rt.execution.application.AppMain.main(


Line 102 is present in the block of code in my program as such

                lucDoc = new Document();

                indexWriter.addDocument(lucDoc);		--- problem line 102



If I limit Step 1 to execute 10000 records then the program runs fine and theres no problem.
However I need to index the entire table either as a single query or an incremental query.

Can someone please help me with these problems.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message