! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
memory leak in the xdesktop -reload
Status:
RESOLVED: DUPLICATE
Product:
Xfdesktop
Component:
General

Comments

Description Andrew 2007-06-03 18:19:17 CEST
User-Agent:       
Build Identifier: 

After reloading background image (using xfdesktop -reload) memory usage of xfdesktop always grows, this can be easly seen by $ top. It is likely some metadata memory is not released.



Reproducible: Always

Steps to Reproduce:
1. Create a large image listing (a lot of file names, mine has 450 entries), e.g. ~/viewlist
2. Setup this file as background images list (e.g. <option name="imagepath_0_0" type="string" value="/home/andrew/viewlist"/> or the same using gui)
3. Issue $ xfdesktop -reload command several times, e.g.:
for (( i=0; i<50; i++ )); do xfdesktop -reload; done
4. Compare results of $ top -p `pidof xfdesktop` before and after step 3.

Actual Results:  
Before step 3:
7459 andrew    15   0 79988  10m 9532 S  0.0  0.7   0:00 0 xfdesktop
After step 3:
7459 andrew    15   0 82708  13m 9808 S  0.0  0.9   0:27 0 xfdesktop
After repeating step 3 again:
7459 andrew    15   0 85384  16m 9808 S  0.0  1.1   0:55 0 xfdesktop


Expected Results:  
Memory usage should not significantly change (perhaps shouldn't change at all).


This error was also present in the xfce4-4.2.0.
Comment 1 Tino Keitel 2007-08-24 11:37:45 CEST
I can reproduce this with a Xfce 4.4.1 built on a Debian Etch:

$ pidof xfdesktop
17164
$ grep RSS /proc/17164/status 
VmRSS:	   17512 kB
$ xfdesktop --reload
$ grep RSS /proc/17164/status 
VmRSS:	   18976 kB
$

My background is set to solid colour.

Comment 2 Tino Keitel 2007-09-05 09:56:54 CEST
I tried to create some debug information with valgrind:

$ G_DEBUG=gc-friendly G_SLICE=always-malloc valgrind --leak-resolution=high --leak-check=full ./xfdesktop >& valgrind.out

After the first try, xfdesktop --reload resulted in this message in valgrind.out:

XfceDesktopMenu init failed (The XfceDesktopMenu module could not be loaded: 
/usr/local/lib/xfce4/modules/xfce4_desktop_menu.so: cannot open shared object fi
le: No such file or directory

After subsequent runs of xfdesktop --reload, the memory usage didn't increase further. I checked this with the following command:

$ grep -E "VmSize|RSS" /proc/`pidof valgrind.bin`/status

Then I copied the xfce4_desktop_menu.so from the source directory to /usr/local/lib/xfce4/modules/ and tried again.

Now the memory usage grew with each xfdesktop --rebuild run.

At the beginning:

$ grep -E "VmSize|RSS" /proc/`pidof valgrind.bin`/status
VmSize:	  146580 kB
VmRSS:	   71040 kB

after 6 reloads:

$ grep -E "VmSize|RSS" /proc/`pidof valgrind.bin`/status
VmSize:	  186872 kB
VmRSS:	  115920 kB
Comment 3 Tino Keitel 2007-09-05 09:57:34 CEST
Created attachment 1347 
valgrind output
Comment 4 Tino Keitel 2007-09-05 09:58:10 CEST
Comment on attachment 1347 
valgrind output

Whoops, wrong file.
Comment 5 Tino Keitel 2007-09-05 09:59:15 CEST
Created attachment 1348 
valgrind output
Comment 6 Brian J. Tarricone (not reading bugmail) 2007-09-05 17:44:06 CEST
As I've said elsewhere, you need to pass --num-callers=50 or so to valgrind.

At any rate, let's move this back to the old bug.  It has more information.

*** This bug has been marked as a duplicate of bug 2427 ***
Comment 7 Andrew 2007-09-05 21:14:43 CEST
Created attachment 1349 
valgrind output for xfce-4.4.1, xfdesktop -reload was issued several times

xfce-4.4.1, xfdesktop -reload was issued several times.
valgrind command:
G_DEBUG=gc-friendly G_SLICE=always-malloc valgrind -v --leak-check=full --leak-resolution=high --num-callers=50 --log-file=xfdesktop-valgrind xfdesktop
Comment 8 Andrew 2007-09-05 21:16:41 CEST
(In reply to comment #7)
> Created an attachment (id=1349) [details]
> valgrind output for xfce-4.4.1, xfdesktop -reload was issued several times
> 
> xfce-4.4.1, xfdesktop -reload was issued several times.
> valgrind command:
> G_DEBUG=gc-friendly G_SLICE=always-malloc valgrind -v --leak-check=full
> --leak-resolution=high --num-callers=50 --log-file=xfdesktop-valgrind xfdesktop
> 

Ooops, wrong list, will resend for bug 2427

Bug #3314

Reported by:
Andrew
Reported on: 2007-06-03
Last modified on: 2009-07-14

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
1 user

Version

Attachments

valgrind output (49 bytes, text/plain)
2007-09-05 09:57 CEST , Tino Keitel
no flags
valgrind output (116.57 KB, text/plain)
2007-09-05 09:59 CEST , Tino Keitel
no flags
valgrind output for xfce-4.4.1, xfdesktop -reload was issued several times (92.87 KB, text/plain)
2007-09-05 21:14 CEST , Andrew
no flags

Additional information