[pylucene-dev] TermDocs.read() method
bachwerk at i5.informatik.rwth-aachen.de
Tue Sep 9 03:39:25 PDT 2008
I'm honestly very poor with memory allocation and stuff, but when using
this .read() method instead of an iteration over all termDocs with
next() I get a huge memory leak.. it just goes up and up and up and
never down.. I've tried using del on the values list, td.close() and
running gc.collect() at times, but nothing seems to make any difference.
I'm running Python 2.4 atm and can't change to 2.5 yet for different
reasons, so I would really appreciate some help here. I will test it on
a 2.5 maching though, just to see if it's the same there or better.
> On Mon, 8 Sep 2008, Martin Bachwerk wrote:
>> I've been trying to use the read() method on TermDocs as described for
>> PyLucene (with an int to specify the number of documents to read in).
>> However, I've been getting an error, that sort of suggests, that the
>> call is actually trying to run the Java API version of the method (with
>> 2 arrays as arguments and an integer n as return value).. This actually
>> works too, but only asfar as the integer, I can't find a way to fill the
>> two arrays.. :(
>> Error trace:
>> docs, freqs = td.read(10)
>> InvalidArgsError: (<type 'TermDocs'>, 'read', (10,))
>> Could someone please help! I'm using PyLucene 2.3.1.
> The docs are out of data here, sorry.
> In the new PyLucene (the one built with JCC, the one you're running),
> the docs should say that a PythonTermDocs instance should be wrapped
> around the TermDocs instance as follows: (also see SpecialsFilter.py
> values = PythonTermDocs(td).read(10)
> Yes, this is quite ugly and I intend to change the way arrays are
> handled in JCC before I release version 2.0 so that this kind of
> kludge is no longer necessary.
>> pylucene-dev mailing list
>> pylucene-dev at osafoundation.org
> pylucene-dev mailing list
> pylucene-dev at osafoundation.org
More information about the pylucene-dev