Last Comment Bug 517793 - Bugzilla under mod_perl leaks RAM because of the Bugzilla::Template::_init method
: Bugzilla under mod_perl leaks RAM because of the Bugzilla::Template::_init me...
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Bugzilla-General (show other bugs)
: 3.4.2
: All All
: -- major (vote)
: Bugzilla 3.4
Assigned To: Max Kanat-Alexander
: default-qa
:
Mentors:
: 517650 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-20 14:08 PDT by Max Kanat-Alexander
Modified: 2010-02-28 10:45 PST (History)
9 users (show)
LpSolit: approval+
LpSolit: approval3.4+
mkanat: blocking3.4.3+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
v1 (3.88 KB, patch)
2009-09-20 14:25 PDT, Max Kanat-Alexander
LpSolit: review+
Details | Diff | Splinter Review

Description Max Kanat-Alexander 2009-09-20 14:08:36 PDT
It looks like the way that we set up our custom parser in Bugzilla::Template::_init must set up a circular reference that we don't deal with properly.

Instead of tracing down the circular reference, I discovered that Template Toolkit has supported an ENCODING parameter (at least since 2.15, that's as far back as I checked) but it's actually just not documented until later versions. (It existed in prior versions, though.) Looking over the code, all we have to do is set ENCODING => 'UTF-8' and we should be good to go.
Comment 1 Max Kanat-Alexander 2009-09-20 14:25:46 PDT
Created attachment 401747 [details] [diff] [review]
v1

Okay, I tested this and it works.

To test it, add some unicode characters to index.html.tmpl, and then try compiling and loading it with and without the ENCODING argument.
Comment 2 Max Kanat-Alexander 2009-09-20 15:10:44 PDT
Oh, actually, on further investigation, this is our entire memory leak. I'm going to leave the patch here, though.

See bug 517650 for information on how I tracked this down.
Comment 3 Max Kanat-Alexander 2009-09-20 15:11:41 PDT
*** Bug 517650 has been marked as a duplicate of this bug. ***
Comment 4 Frédéric Buclin 2009-09-22 10:39:23 PDT
Comment on attachment 401747 [details] [diff] [review]
v1

Tested with french and japanese templates on 3.4.2. Works as expected. Great cleanup! r=LpSolit
Comment 5 Max Kanat-Alexander 2009-09-26 16:38:22 PDT
tip:

Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.108; previous revision: 1.107
done
Removing Bugzilla/Template/Parser.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template/Parser.pm,v  <--  Parser.pm
new revision: delete; previous revision: 1.1
done

3.4:

Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.99.2.3; previous revision: 1.99.2.2
done
Removing Bugzilla/Template/Parser.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template/Attic/Parser.pm,v  <--  Parser.pm
new revision: delete; previous revision: 1.1
done

Note You need to log in before you can comment on or make changes to this bug.