Memory leak in PerFieldAnalyzer

Hello everyone,

we’ve recently discovered a memory leak in the
PerFieldAnalyzer. If you use the PerFieldAnalyzer
(which you acutally should), you should switch
to a pure ruby version of that analyzer. The C
version of the Analyzer is consuming memory
on every analyzing request.

You can find an example script to verify the
leak[1]. Furthermore we’ve added a
workaround, building a PerFieldAnalyzer
in pure ruby[2]. You can read more about the
leak on the omdb tech blog[3].

Benjamin


[1] Parked at Loopia
[2] Parked at Loopia
[3] http://blog.omdb-beta.org/2007/7/29/tracking-down-a-memory-leak-
in-ferret-0-11-4

On Sun, Jul 29, 2007 at 12:33:53PM +0200, Benjamin K. wrote:

leak[1]. Furthermore we’ve added a
workaround, building a PerFieldAnalyzer
in pure ruby[2]. You can read more about the
leak on the omdb tech blog[3].

Great work!

And now included in acts_as_ferret’s trunk :slight_smile:

I put your new PerFieldAnalyzer in the Ferret::Analysis namespace so it
hides the original implementation and no changes to existing code are
needed.

cheers,
Jens


Jens Krämer
http://www.jkraemer.net/ - Blog
http://www.omdb.org/ - The new free film database

Benjamin K. wrote:

Hello everyone,

we’ve recently discovered a memory leak in the
PerFieldAnalyzer. If you use the PerFieldAnalyzer
(which you acutally should), you should switch
to a pure ruby version of that analyzer. The C
version of the Analyzer is consuming memory
on every analyzing request.

Is this relevant to those of us who do not explicitly use
PerFieldAnalyzer? i.e. is it used behind the scenes unless you say
otherwise?

Ed

On Mon, Jul 30, 2007 at 08:16:43PM +0200, Ed – wrote:

Is this relevant to those of us who do not explicitly use
PerFieldAnalyzer? i.e. is it used behind the scenes unless you say
otherwise?

no, PerFieldAnalyzer is only used if you tell Ferret to do so.

Jens


Jens Krämer
http://www.jkraemer.net/ - Blog
http://www.omdb.org/ - The new free film database