Terence,
> 2) I have a background process to update the index files. If I keep
> the IndexSearcher opened, I am not sure whether it will pick up the
> changes from the index updates done in the background process.
This is a frequently asked question. Basically, you have to make use
of IndexReade
Use the life-cycle hooks mentioned in another email
(activate/passivate) and when you detect that the server is about to
unload your class, call close() on IndexSearcher. I haven't used
Lucene in an EJB environment, so I don't know the details,
unfortunately. :(
Your simulation may be too fast fo
Terence,
Calling close() on IndexSearcher will not release the memory
immediately. It will only release resources (e.g. other Java objects
used by IndexSearcher), and it is up to the JVM's garbage collector to
actually reclaim/release the previously used memory. There are
command-line parameters
Hi David,
In my test program, I invoke the IndexSearcher.close() method at the end of the loop.
However, it doesn't seems to release the memory. My concern is that even though I put
the IndexSearcher.close() statement in the hook methods, it may not release all the
memory until the application
> I tried to reuse the IndexSearcher, but I have another question. What
> happen if an application server unloads the class after it is idle for a
> while, and then re-instantiate the object back when it recieves a new
> request?
The EJB spec takes this into account, as there are hook methods you
Hi,
I tried to reuse the IndexSearcher, but I have another question. What happen if an
application server unloads the class after it is idle for a while, and then
re-instantiate the object back when it recieves a new request?
Everytime the server re-instantiates the class, a new IndexSearcher i
Hi Otis,
The reason why I ran into this problem is that I partition my search documents into
multiple index directories ordered by document modified date. My application only
returns the lastest 500 documents that matches the criteria. By partitioning the
documents into different directories, w
Thanks for pointing this out. Even I fixed the code to close the "fsDir" and also add
the ex.printStackTrace(System.out), I am still hitting the OutOfMemeoryError.
Terence
> On Wednesday 18 August 2004 00:30, Terence Lai wrote:
> > Â Â Â Â Â Â if (fsDir != null) {> Â Â Â Â Â Â Â Â try {> Â Â Â