Forum: Ferret Memory leak in PerFieldAnalyzer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D148c5959e4eccc97f33244f1c5396e9?d=identicon&s=25 Benjamin Krause (Guest)
on 2007-07-29 12:35
(Received via mailing list)
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] http://pastie.caboo.se/83195
[2] http://pastie.caboo.se/83194
[3] http://blog.omdb-beta.org/2007/7/29/tracking-down-...
in-ferret-0-11-4
36feb4959db6ab8259a44962f0fa761f?d=identicon&s=25 Jens Kraemer (Guest)
on 2007-07-29 13:09
(Received via mailing list)
On Sun, Jul 29, 2007 at 12:33:53PM +0200, Benjamin Krause 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 :-)

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
44896977650aef424270590e60b39964?d=identicon&s=25 Ed -- (epo001)
on 2007-07-30 20:16
Benjamin Krause 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
36feb4959db6ab8259a44962f0fa761f?d=identicon&s=25 Jens Kraemer (Guest)
on 2007-07-30 20:21
(Received via mailing list)
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
This topic is locked and can not be replied to.