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

RESOLVED DUPLICATE of bug 517793

Status

()

defect
--
major
RESOLVED DUPLICATE of bug 517793
10 years ago
10 years ago

People

(Reporter: mkanat, Unassigned)

Tracking

Bug Flags:
blocking3.4.3 +

Details

(Reporter)

Description

10 years ago
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).
(Reporter)

Comment 1

10 years ago
Okay, if I run a script that does nothing, it doesn't leak.
(Reporter)

Comment 2

10 years ago
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;
(Reporter)

Comment 3

10 years ago
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);
(Reporter)

Comment 4

10 years ago
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);

Updated

10 years ago
Flags: blocking3.4.3?
(Reporter)

Updated

10 years ago
Flags: blocking3.4.3? → blocking3.4.3+
(Reporter)

Comment 5

10 years ago
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.
(Reporter)

Updated

10 years ago
Depends on: 517793
(Reporter)

Comment 6

10 years ago
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
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Target Milestone: Bugzilla 3.4 → ---
Duplicate of bug: 517793
(Reporter)

Updated

10 years ago
No longer depends on: 517793
You need to log in before you can comment on or make changes to this bug.