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.
Benjamin K. (Guest)
on 2007-07-29 14: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
Jens K. (Guest)
on 2007-07-29 15:09
(Received via mailing list)
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 :-)

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
Ed -. (Guest)
on 2007-07-30 22:16
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
Jens K. (Guest)
on 2007-07-30 22: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.