After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 612318 - Add generic way to catch memory leak
Add generic way to catch memory leak
Status: RESOLVED INCOMPLETE
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-03-09 17:34 UTC by Maxim Ermilov
Modified: 2014-10-24 20:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add shell_global_debug_exit (1.87 KB, patch)
2010-03-09 17:34 UTC, Maxim Ermilov
none Details | Review
Fix g_file_enumerator_next_files_finish annotation (625 bytes, patch)
2010-03-09 17:36 UTC, Maxim Ermilov
committed Details | Review
Strange memory leak. (1.06 KB, patch)
2010-03-09 17:38 UTC, Maxim Ermilov
needs-work Details | Review
unref theme_node in st_widget_dispose (782 bytes, patch)
2010-03-17 15:48 UTC, Maxim Ermilov
committed Details | Review
Fix JSObject leak in workspace.js (1.98 KB, patch)
2010-03-17 15:49 UTC, Maxim Ermilov
reviewed Details | Review
Add shell_global_mem_report (2.33 KB, patch)
2010-03-17 21:39 UTC, Maxim Ermilov
rejected Details | Review
Fix JSObject leak in workspace.js (2.58 KB, patch)
2010-03-17 22:28 UTC, Maxim Ermilov
committed Details | Review
[WindowClone] Fix dnd regression (1.73 KB, patch)
2010-03-18 20:16 UTC, Maxim Ermilov
rejected Details | Review

Description Maxim Ermilov 2010-03-09 17:34:48 UTC
Created attachment 155667 [details] [review]
Add shell_global_debug_exit

Primarily useful for debugging.
If Shell was run with -v option, It will show amount of leak JS objects.
(It will show Gtype for leaked object With small gjs modification)
Comment 1 Maxim Ermilov 2010-03-09 17:36:42 UTC
Created attachment 155668 [details] [review]
Fix g_file_enumerator_next_files_finish annotation

(Easily catched with previous patch.)
Comment 2 Maxim Ermilov 2010-03-09 17:38:02 UTC
Created attachment 155669 [details] [review]
Strange memory leak.

Strange memory leak.

ClutterText & StThemeNode was leak.
Comment 3 Florian Müllner 2010-03-10 09:25:21 UTC
Review of attachment 155669 [details] [review]:

::: js/ui/workspace.js
@@ +564,3 @@
 
+            return;
+        if (this.title.get_stage())

The function is only called when this.title is parented, so you are effectively disabling the function here:

if (true)
  return;

As a result, the positions of both captions and close buttons are completely messed up.
Comment 4 Maxim Ermilov 2010-03-17 15:48:32 UTC
Created attachment 156372 [details] [review]
unref theme_node in st_widget_dispose
Comment 5 Maxim Ermilov 2010-03-17 15:49:06 UTC
Created attachment 156373 [details] [review]
Fix JSObject leak in workspace.js
Comment 6 Colin Walters 2010-03-17 18:14:59 UTC
Review of attachment 156372 [details] [review]:

Good catch!
Comment 7 Colin Walters 2010-03-17 18:15:00 UTC
Review of attachment 156372 [details] [review]:

Good catch!
Comment 8 Maxim Ermilov 2010-03-17 21:39:46 UTC
Created attachment 156401 [details] [review]
Add shell_global_mem_report

Primarily useful for debugging.
If Shell was run with -v option, It will show amount of leak JS objects.
If mozilla-js was compiled with --enable-debug, It Dump the object graph
of heap-allocated things.
Comment 9 Colin Walters 2010-03-17 21:46:46 UTC
Attachment 155668 [details] pushed as d6223d6 - Fix g_file_enumerator_next_files_finish annotation
Comment 10 Colin Walters 2010-03-17 22:00:41 UTC
Review of attachment 156373 [details] [review]:

::: js/ui/workspace.js
@@ +204,3 @@
             this._zoomLightbox.destroy();
         if (this._zoomLightbox)
+        this._draggable.disconnectAll();

Maybe DND.makeDraggable() should actor.connect('destroy') and call disconnectAll() and unset this.actor on itself?

@@ +1374,1 @@
 

This looks obviously right.

@@ +1480,3 @@
 
+            Main.overview.disconnect(this._overviewHiddenId);
+        if (this._overviewHiddenId)

This is correct too, but to make me happy, please set this._overviewHiddenId = 0;

@@ +1496,3 @@
         for (let w = 1; w < this._windows.length; w++)
+            this._windows[i].disconnectAll();
+        for (let i = 0; i < this._windows.length; i++)

I think we should move the disconnectAll() into WindowClone:destroy

@@ +1497,3 @@
+        this._windows = [];
+            this._windows[i].disconnectAll();
+        for (let i = 0; i < this._windows.length; i++)

Looks right.
Comment 11 Colin Walters 2010-03-17 22:06:40 UTC
Review of attachment 156401 [details] [review]:

See also:

https://bugzilla.gnome.org/show_bug.cgi?id=613048
Comment 12 Maxim Ermilov 2010-03-17 22:28:55 UTC
Created attachment 156405 [details] [review]
Fix JSObject leak in workspace.js
Comment 13 Colin Walters 2010-03-17 23:33:20 UTC
Review of attachment 156405 [details] [review]:

This looks good.
Comment 14 Maxim Ermilov 2010-03-18 20:16:11 UTC
Created attachment 156510 [details] [review]
 [WindowClone] Fix dnd regression

dnd in SingleView stop work after 'Fix JSObject leak in workspace.js' commit
Comment 15 Colin Walters 2010-03-29 14:31:36 UTC
Review of attachment 156510 [details] [review]:

What bug is this patch fixing?  I see that we're trying to ensure we emit drag-end, but what issue is that fixing?
Comment 16 Colin Walters 2010-05-10 17:38:03 UTC
Review of attachment 156401 [details] [review]:

Are you calling this from looking glass or ./src/gnome-shell --eval?  I don't see a patch to add a "-v" option.

Unfortunately we don't have a very good way to hook in stuff after the mainloop exits since that comes from mutter.

::: src/shell-global.c
@@ +166,3 @@
+{
+shell_global_mem_report (ShellGlobal *global)
+void

What defines this?  Are you expected to run "make -DDEBUG?
Comment 17 Jasper St. Pierre (not reading bugmail) 2011-08-03 19:48:55 UTC
Comment on attachment 156401 [details] [review]
Add shell_global_mem_report

I don't think we want this in its current form. Marking rejected to get off of review list.
Comment 18 Jasper St. Pierre (not reading bugmail) 2011-08-03 19:49:02 UTC
Comment on attachment 156510 [details] [review]
 [WindowClone] Fix dnd regression

If this is still necessary, please file a separate bug.
Comment 19 Anthony Ruhier 2012-11-12 09:51:54 UTC
There is a way to see quickly the memory leak : click many times on an element of the top bar (like calendar or the username menu) and see the memory consumption of the gnome-shell process increases.

It's working for the activites menu too.
Comment 20 Allan Day 2014-08-07 09:58:01 UTC
I see three patches that were committed as a part of this bug, and the report hasn't been touched for a long time. If there is anything else to do, can someone please state what it is?
Comment 21 Anthony Ruhier 2014-08-07 16:27:48 UTC
In my opinion, we can consider now that it's a duplicate of that bugreport: https://bugzilla.gnome.org/show_bug.cgi?id=685513
Comment 22 André Klapper 2014-10-24 20:17:19 UTC
(In reply to comment #20)
> I see three patches that were committed as a part of this bug, and the report
> hasn't been touched for a long time. If there is anything else to do, can
> someone please state what it is?

==> No reply; closing as INCOMPLETE.