Bug 3578 - [BROKEN BUG] Large constant memory leak
Summary: [BROKEN BUG] Large constant memory leak
Status: CLOSED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: App/xcompmgr (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high critical
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-20 01:45 UTC by Daniel Stone
Modified: 2011-10-15 17:09 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description FreeDesktop Bugzilla Database Corruption Fix User 2005-06-20 01:45:15 UTC
Xcompmgr appears to continually leak memory - when run under memprof, the memory
usage increased to several megabytes in a few minutes.

The set_ignore function, called from print_all, malloc's memory and attaches it
to a linked list.  Every iteration of print_all calls this function, which means
if a window is changing, a few bytes of memory are allocated several times a second.
The list appears to only be deleted (from discard_ignore) when a new window
appears (something I noticed when a tooltip appears over memprof's 'leak' button).

In the main loop (line 2063), discard_ignore is called only when (ev.type & 0x7f
!= KeymapNotify).  If this if statement is removed, allowing discard_ignore to
always run, the memory usage remains below 64k, and doesn't continually increase. 

I don't have time to determine if that's just a bad hack, but it works for me.


There's also a memory leak in determine_wintype, line 1407, where the function
returns without having freed data.


The following patch fixes both:


Index: xcompmgr.c
===================================================================
RCS file: /cvs/xapps/xcompmgr/xcompmgr.c,v
retrieving revision 1.39
diff -r1.39 xcompmgr.c
1405a1406,1407
>       {
>               XFree ((void *)children);
1406a1409
>       }
2059c2062
<           if (ev.type & 0x7f != KeymapNotify)
---
>           //if (ev.type & 0x7f != KeymapNotify)
Comment 1 Marius Gedminas 2007-02-08 11:39:36 UTC
What an interesting empty bug.

Maybe it refers to this: when you enable fading (xcompmgr -fF), xcompmgr causes the X server's memory usage to slowly grow up without any apparent bounds, filling up gigabytes if you keep it running for a couple of days.  If you kill xcompmgr, the X server frees that memory, so it's not a leak in the server.

(First reported at https://launchpad.net/ubuntu/+source/xcompmgr/+bug/65874)
Comment 2 Benjamin Close 2008-01-11 02:38:03 UTC
Bugzilla Upgrade Mass Bug Change

NEEDSINFO state was removed in Bugzilla 3.x, reopening any bugs previously listed as NEEDSINFO.

  - benjsc
    fd.o Wrangler
Comment 3 Daniel Stone 2008-04-06 12:12:34 UTC
nuking broken bug.
Comment 4 Marius Gedminas 2008-09-17 23:29:15 UTC
Looks like the bug is no longer broken.  Previously the initial description field was empty; now I can see meaningful contents.  Reopening.
Comment 5 Jeremy Huddleston Sequoia 2011-09-24 20:21:04 UTC
No response from original reporter (in launchpad).  very little to go on.  The provided patch has no context, so I'm not even sure where it would apply, but it looks wrong.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.