[Bug 2141] New: cpugraph leaks memory

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 2141] New: cpugraph leaks memory

bugzilla-daemon
Do NOT reply to this email.  To make further comments on this bug, use
the URL below:
http://bugzilla.xfce.org/show_bug.cgi?id=2141

           Summary: cpugraph leaks memory
           Product: Xfce Panel Plugins
           Version: unspecified
          Platform: PC (x86)
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: Medium
         Component: cpugraph
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]


User-Agent:       Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.5)
Gecko/20060719 Firefox/1.5.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.5)
Gecko/20060719 Firefox/1.5.0.5

When running for a longer time, one day or so, cpugraph is using about 35mb of
memory.
The following fixed it for me:

--- cpu.c.old   2006-08-09 11:02:40.446805504 +0200
+++ cpu.c       2006-08-09 01:26:29.950955461 +0200
@@ -244,7 +244,7 @@
 void
 UpdateTooltip (CPUGraph * base)
 {
-    char tooltip[32];
+    static char tooltip[32];

     sprintf (tooltip, "Usage: %ld%%", base->m_CPUUsage);
     gtk_tooltips_set_tip (GTK_TOOLTIPS (base->m_Tooltip),


Reproducible: Always

Steps to Reproduce:


--
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
xfce-goodies-dev mailing list
[hidden email]
http://bat.berlios.de/mailman/listinfo/xfce-goodies-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 2141] cpugraph leaks memory

bugzilla-daemon
Do NOT reply to this email.  To make further comments on this bug, use
the URL below:
http://bugzilla.xfce.org/show_bug.cgi?id=2141





------- Comment #1 from [hidden email]  2006-08-09 09:46 UTC -------
It's better to free the tooltip:

void
UpdateTooltip (CPUGraph * base)
{
    gchar *tooltip;

    tooltip = g_strdup_printf ("Usage: %ld%%", base->m_CPUUsage);
    gtk_tooltips_set_tip (GTK_TOOLTIPS (base->m_Tooltip),
                          base->m_FrameWidget->parent, tooltip, NULL);
    g_free (tooltip);
}

Maybe "char tooltip[32]" > "const char tooltip[32]" will also work.


--
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
xfce-goodies-dev mailing list
[hidden email]
http://bat.berlios.de/mailman/listinfo/xfce-goodies-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 2141] cpugraph leaks memory

bugzilla-daemon
In reply to this post by bugzilla-daemon
Do NOT reply to this email.  To make further comments on this bug, use
the URL below:
http://bugzilla.xfce.org/show_bug.cgi?id=2141





------- Comment #2 from [hidden email]  2006-08-09 14:27 UTC -------
Ehm, that's definitely not the cause of a memory leak.


--
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
xfce-goodies-dev mailing list
[hidden email]
http://bat.berlios.de/mailman/listinfo/xfce-goodies-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 2141] cpugraph leaks memory

bugzilla-daemon
In reply to this post by bugzilla-daemon
Do NOT reply to this email.  To make further comments on this bug, use
the URL below:
http://bugzilla.xfce.org/show_bug.cgi?id=2141





------- Comment #3 from [hidden email]  2006-08-10 08:49 UTC -------
ok, you're right.
the problem only appears when using LED-mode. everything is fine in normal
mode.


--
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
xfce-goodies-dev mailing list
[hidden email]
http://bat.berlios.de/mailman/listinfo/xfce-goodies-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 2141] cpugraph leaks memory

bugzilla-daemon
In reply to this post by bugzilla-daemon
Do NOT reply to this email.  To make further comments on this bug, use
the URL below:
http://bugzilla.xfce.org/show_bug.cgi?id=2141





------- Comment #4 from [hidden email]  2006-08-12 09:45 UTC -------
the DrawGraph function doesn't unref all the GdkGC it can create maybe it could
be the cause of such memleak


--
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
xfce-goodies-dev mailing list
[hidden email]
http://bat.berlios.de/mailman/listinfo/xfce-goodies-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 2141] cpugraph leaks memory

bugzilla-daemon
In reply to this post by bugzilla-daemon
Do not reply to this email.  To comment on this bug, please visit:
http://bugzilla.xfce.org/show_bug.cgi?id=2141





------- Comment #5 from [hidden email]  2006-08-16 11:50 UTC -------
Created an attachment (id=740)
 --> (http://bugzilla.xfce.org/attachment.cgi?id=740&action=view)
Free gc's

In two modes a gc isn't freed after use. This was the only obvious memory leak
I could find, but I didn't look very thoroughly.


--
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
xfce-goodies-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/xfce-goodies-dev
Reply | Threaded
Open this post in threaded view
|

[Bug 2141] cpugraph leaks memory

bugzilla-daemon
In reply to this post by bugzilla-daemon
Do not reply to this email.  To comment on this bug, please visit:
http://bugzilla.xfce.org/show_bug.cgi?id=2141





------- Comment #6 from [hidden email]  2006-08-16 13:41 UTC -------
Ok, I committed the changes with revision 1906. It would be helpful if you
could test the patch or update from SVN.


--
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
xfce-goodies-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/xfce-goodies-dev