[Catalyst] FormBuilder + C::C::Formbuilder memory leak fixes

Juan Camacho jc5826 at gmail.com
Thu Feb 1 04:37:36 GMT 2007


On 1/31/07, Victor Igumnov <victori at lamer0.com> wrote:
>
>
> To see the impact of the memory leak.
>
>
> Run broken.pl first which will run formbuilder against your installed ver=
sion.
> It will create a new formbuilder instance over and over, watch top -o siz=
e as it grows to 100-200 megs in just a few seconds.
>
>
> Now run fixed.pl  - works great don't it? No memory leaks what so ever.
>
>
> I have also included a CatTest catalyst project which uses C::C::FormBuil=
der. With everything patched up the process stays at ~14 megs while being h=
ammered by ab -n 900 -c 100 http://localhost:3000/.
>
>
> So the question is am I the only one using formbuilder? This leak was ver=
y obvious.
>
>
> All tests pass for both projects.
>
>
> http://temp.fabulously40.com/~victori/CGI-FormBuilder-3.05-memfix.tbz
>
>
> -victor
>

Thank you Victor for pointing out the memory leak. I've attached your
diff files here to make it easier on folks.

After looking at it, I think your patch is just a workaround for the
circular references in CGI::FormBuilder and fixing these problems
directly instead of cloning references is a better approach.  I have
submitted a bug report to Nate at
http://rt.cpan.org/Ticket/Display.html?id=3D24696 and he has already
said he would look into it.

Juan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memfix-for-c-c-formbuilder.diff
Type: application/octet-stream
Size: 721 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070131/149d=
c0f9/memfix-for-c-c-formbuilder.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memleakfix-for-cgi-formbuilder.diff
Type: application/octet-stream
Size: 1343 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070131/149d=
c0f9/memleakfix-for-cgi-formbuilder.obj


More information about the Catalyst mailing list