On Wed, 27 Feb 2008, João Rodrigues wrote:
With Pylucene's JCC version, the initVM method must be called before I can
operate with lucene. However, do I have to call it each time I import
lucene? For instance, if I have two scripts, will I have to call it on the
first, and then on the other?
You have to call it before the first time you make a call using a Lucene
API. The second time you import lucene into the same process, nothing
really happens, Python has already imported the module, there is no need to
call initVM() again.
Another Q: How do I "shut the VM off"? I mean, at the end of my script, I
want the memory it uses to be freed. How do I turn off the VM?
When you quit Python, the entire process' memory is freed including the one
owned by the JVM. There is an API to destroy the Java VM but it's not
currently available from PyLucene. I could add support for it but didn't
think it was useful. If you're thinking of repeatedly, in the same process,
calling initVM() and say, a new function called terminateVM(), think again.
It's not too efficient.
Andi..
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev