Closed Bug 517650 Opened 15 years ago Closed 15 years ago

Bugzilla leaks about 512K of RAM on every call, under mod_perl

Categories

(Bugzilla :: Bugzilla-General, defect)

3.4.2
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 517793

People

(Reporter: mkanat, Unassigned)

Details

I'm not quite sure why yet, but it seems that Bugzilla has started leaking about 512K of RAM on every call. I'm seeing this at least on 3.4 and HEAD.

To reproduce this issue, start your apache with just one server (ServerLimit 1) and then add these two lines to the end of index.cgi:

use GTop;
warn GTop->new->mem->used;

And then just reload index.cgi over and over.

You'll see the number increase every time, when it should just be staying the same.

This might have the same root cause as bug 516457, and is similar to an old memory leak that we fixed (bug 343166).
Okay, if I run a script that does nothing, it doesn't leak.
The following script leaks memory unpredictably (only once every few calls):

#!/usr/bin/perl -T
use strict;
no warnings;
use lib qw(. lib);
use GTop;
use Bugzilla;

my $template = Bugzilla->template;
warn GTop->new->mem->used;
The following shows a memory leak even if run at the command line:

sub create_template {
    my $template = Bugzilla::Template->create();
    print GTop->new->mem->used, "\n";
}
create_template() for (1..30);
At least part (or all) of the leak is being caused by this line in _init in Bugzilla::Template:

    # Now we need to re-create the default Service object, making it aware
    # of our Parser object.
    $self->{SERVICE} = $config->{SERVICE}
        = Template::Config->service($config);
Flags: blocking3.4.3?
Flags: blocking3.4.3? → blocking3.4.3+
Okay, I resolved that memory leak (I have to test my patch still, and then I will post it here or in another bug), but it doesn't resolve the major leak.
Depends on: 517793
Actually, on further investigation, that seems to have been the entire memory leak. Once I resolve it, GTop still shows an increase in memory usage, but "top" doesn't show the process actually growing, so I'm assuming that I was just mis-using GTop or that it has a bug.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Target Milestone: Bugzilla 3.4 → ---
No longer depends on: 517793
You need to log in before you can comment on or make changes to this bug.