On Apr 18, 2008, at 7:13, "João Rodrigues" <[EMAIL PROTECTED]> wrote:
Hello all.
I am developing an application that uses pyLucene to index a few
documents and allow the user to perform searches on them. It is
composed, basically, of an Indexer.py script and a Searcher.py
script. They run separately and my only issue is with the
Searcher.py script..
I usually work in Linux. However, my application is to be used in
Windows as well. To run my Searcher script, I have two options: if
the machine's RAM is big enough to support the index, it uses a
RAMDirectory. If it isn't, it uses an FSDirectory, and is
considerably slower. To check my machine's RAM in linux, I use the
'free -m' comand, while in windows, it's a big function: http://pastebin.com/m3360912a
Running my script in my windows machine, with 2GB of RAM, it gives
me the following output:
* Setting up software parameters..
--- Calculating index size: 1188 MB
--- Calculating RAM memory size: 2015 MB (Windows)
Traceback (most recent call last):
File "C:\Documents and Settings\joaorodrigues\Desktop\QuExT\QuExT
\Source Code\QuExT.py", line 19, in <module>
from QE_v3 import assembly, queryExpansion
File "C:\Documents and Settings\joaorodrigues\Desktop\QuExT\QuExT
\Source Code\QE_v3.py", line 104, in <module>
lucene.initVM(lucene.CLASSPATH, maxheap='2g')
ValueError: An error occurred while creating Java VM
So, it's probably because I'm using not a "pure" python script, but
the *.exe that results of py2exe execution on my script. So, I tried
to run my script in IDLE, giving my the exact same output. So, then
I thought, well, since 2GB = 2048MB, and the script reports only
2015, that's my problem. So, I ran the script again, but the maxheap
was set to '2000m'. Well, it gave me that output again.
The script runs beautifully on linux, performing all the tests it
has to perform, checking all parameters and actually *working* the
way it should work. So, I guess this rules out an error in my code,
since the only difference in the OS's in my script is the way the
RAM is measured.
So, I'm at a dead-end (once again). I don't know what I can do, what
I should do.
I don't that this is a PyLucene problem but a problem with starting
the VM on windows. On Windows, are you able to start a 'hello world'
type Java application with:
java -Xmx=2g ...... ?
Have you considered using an MMapDirectory instead of an FSDirectory,
thereby letting the OS play the tricks you're playing ?
Switching to that class can be as simple as setting a property. See
the Lucene docs for more info.
Andi..
Also, regarding py2exe, since I'm not sure it works perfectly with
pyLucene, can anyone tell me their experience (if any) on that matter?
Finally, how do I uninstall pyLucene in windows? I wanted to remove
completely all traces of pylucene and then install it again. Just to
rule out any "instalation" problem.
Thanks in advance, and sorry for the long rant.
João Rodrigues
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev