[Xapian-discuss] Moving to 1.0.x

Mike Boone boonedocks at gmail.com
Wed Oct 10 13:59:46 BST 2007


On 10/10/07, Olly Betts <olly at survex.com> wrote:
> This is the code I was testing with, which reported growing memory usage
> before and now reports constant usage (for both PHP4 and PHP5):
>
>     for ($i = 0; $i < 1000000; ++$i) {
>         print memory_get_usage()."\n";
>         $doc = new XapianDocument();
>     }

OK, your code ran fine and the memory was constant. I also threw in a
add_document call and it was still constant. I next tried the stemmer
and that is at least part of the problem:

$stemmer = new XapianStem('english');

for ($i = 0; $i < 1000000; ++$i) {
  print memory_get_usage()."\n";
  $doc = new XapianDocument();
  $stemmed_word = $stemmer->apply('testing');
}

With that code the memory usage grew from 456KB to 15.5MB. That might
be all of my problem as I stem a lot of words per document.



More information about the Xapian-discuss mailing list