Closed Bug 1282606 Opened 3 years ago Closed 3 years ago

Fix TrackingFlags and Bug object memory leaks

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: dylan, Assigned: dylan)

References

Details

Attachments

(1 file, 3 obsolete files)

Under heavy usage, the bug modal edit API will cause web workers to run out of memory every 60 seconds. It's a good idea to fix the memory leak now.
Version: Development/Staging → Production
Attached patch 1282606_1.patch (obsolete) — Splinter Review
This should fix much of the memory leaks. Running under mod_perl, you can run 'ab' against the bug modal API to test. -c 4 -n 1000 should result in frequent SizeLimit messages in the error log. With this patch applied, memory usage (for that API) should be nearly constant.
Attachment #8765642 - Flags: review?(dkl)
Attached patch 1282606_2.patch (obsolete) — Splinter Review
This removes the majority of memory leaks from BMO.
Attachment #8765642 - Attachment is obsolete: true
Attachment #8765642 - Flags: review?(dkl)
Attachment #8765968 - Flags: review?(dkl)
Attached patch 1282606_3.patch (obsolete) — Splinter Review
wrong patch. This one should work.
Attachment #8765968 - Attachment is obsolete: true
Attachment #8765968 - Flags: review?(dkl)
Attachment #8765969 - Flags: review?(dkl)
Attached patch 1282606_4.patchSplinter Review
Attachment #8765969 - Attachment is obsolete: true
Attachment #8765969 - Flags: review?(dkl)
Attachment #8765972 - Flags: review?(dkl)
Comment on attachment 8765972 [details] [diff] [review]
1282606_4.patch

Review of attachment 8765972 [details] [diff] [review]:
-----------------------------------------------------------------

mac-thor?

Fix comments on commit. r=dkl

::: Bugzilla/Comment.pm
@@ +241,5 @@
>  sub bug {
>      my $self = shift;
>      require Bugzilla::Bug;
> +    my $bug = $self->{bug} ||= new Bugzilla::Bug($self->bug_id);
> +    weaken($self->{bug});

need to import 'weaken' at the beginning of Comment.pm

::: extensions/TrackingFlags/Extension.pm
@@ +555,5 @@
> +sub request_cleanup {
> +    foreach my $flag (@FLAG_CACHE) {
> +        my $bug_flag = delete $flag->{bug_flag};
> +        if ($bug_flag) {
> +            my $bug = delete $bug_flag->{bug};

nit: no need to assign to $bug, just do delete $bug_flag->{bug};
Attachment #8765972 - Flags: review?(dkl) → review+
To git@github.com:mozilla-bteam/bmo.git
   3bf65ba..9a15297  master -> master
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Summary: Fix TrackingFlags memory leak → Fix TrackingFlags and Bug object memory leaks
Blocks: 1301951
Component: Extensions: TrackingFlags → Extensions
You need to log in before you can comment on or make changes to this bug.