! 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 “reload” code
Status:
CLOSED: FIXED
Product:
Ristretto
Component:
Application

Comments

Description Yves-Alexis Perez editbugs 2008-10-21 09:48:51 CEST
Hi,

I'm currently graphing something with dot, and find convenient to use the “autoreload” feature of ristretto.

I open once the generated svg with ristretto, then edit my dot file, generate the svg, and automagically ristretto reloads it and display the result.

But doing this, I discovered a (quite huge) memory leak, I guess somewhere in the reload code (or maybe in the closing or opening, not sure what is run during reload).

I can reproduce the problem with:

corsac@miria: import -w root trouc.png; ristretto trouc.png & sleep 1; echo "Before:" ;grep "Vm(Size|RSS|Data)" /proc/$(pidof ristretto)/status;import -w root trouc.png;sleep 1;echo "After:"; grep "Vm(Size|RSS|Data)" /proc/$(pidof ristretto)/status;import -w root trouc.png;sleep 1;echo "After:"; grep "Vm(Size|RSS|Data)" /proc/$(pidof ristretto)/status
[1] 7581
Before:
VmSize:	  158600 kB
VmRSS:	   22756 kB
VmData:	   13676 kB
After:
VmSize:	  162440 kB
VmRSS:	   26596 kB
VmData:	   17516 kB
After:
VmSize:	  173960 kB
VmRSS:	   38116 kB
VmData:	   29036 kB

Nothing is freed before/after a reload, so in my case it quickly lead to a huge occupation. I didn't understand why the box was that slow with 2GB ram, until OOM killed ristretto :)

Cheers,
Comment 1 Yves-Alexis Perez editbugs 2008-10-21 21:14:30 CEST
Created attachment 1916 
valgrind log

 G_DEBUG=gc-friendly G_SLICE=always-malloc valgrind --leak-check=full --log-file=ristretto.log -v ristretto trouc.png

and then some import -w root trouc.png to force reload.
Comment 2 Stephan Arts editbugs 2008-10-22 05:43:42 CEST
I think I fixed it in revision 5744. Could you confirm?
Comment 3 Yves-Alexis Perez editbugs 2008-10-22 06:31:27 CEST
(In reply to comment #2)
> I think I fixed it in revision 5744. Could you confirm?

Looks fixed, thanks!
Comment 4 Stephan Arts editbugs 2008-10-22 09:43:45 CEST
ok, closing this bug.

Bug #4508

Reported by:
Yves-Alexis Perez
Reported on: 2008-10-21
Last modified on: 2009-07-14

People

Assignee:
Stephan Arts
CC List:
0 users

Version

Version:
unspecified

Attachments

valgrind log (38.12 KB, text/plain)
2008-10-21 21:14 CEST , Yves-Alexis Perez
no flags

Additional information