[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory leak - cairo/x11 backend

From: Fred Kiefer
Subject: Re: memory leak - cairo/x11 backend
Date: Sat, 21 Dec 2013 17:36:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

I am able to reproduce this behaviour, but I am unsure about what it
means. I did an in depth inspection with the memory panel of GNUstep,
but this didn't show up a specific issue. (BTW the memory panel is hard
to use with Laterna Magica. The AppController registers itself for the
notification NSTableViewSelectionDidChangeNotification and as the
fileListView is still null at the point in time where this happens it
will get called even from the memory panel. The same is true for the
other notification. You should move these calls into the awakeFromNib

There is a lot of other strange code in Laterna Magica, for example:

  [view setImage: destImage];
  [view setNeedsDisplay:YES];
  [[view superview] setNeedsDisplay:YES];
  [window displayIfNeeded];

Here only the first line should be needed. Why is the rest there?
But none of that looks like an obvious memory leak.

I also tried to see any specific memory leaks with valgrind, but here
the normal GNUstep leaks overshadow the output.

And I am still not completely convinced that there is a problem. When I
keep on loading and removing images the size of the XOrg process keeps
returning to the same value it had before. Not to the initial one, but
it does not keep on growing endlessly. It is more like the biggest image
ever loaded in Laterna Magica determines the additional resource usage
of the X process.


On 20.12.2013 15:46, Riccardo Mottola wrote:
> Hi developers,
> thanks for looking. I have seen Fred patched your patch, now I tested
> everything, on cairo for now.
> I tested everything before and after.
> Task: load two images. Check memory of Xorg and LM
> 1) before
> then load two images in LM
> 2) displaying the last image (automatically selected
> 3) displaying the butlast image (changing image)
> 4) removing them again. through the Clear menu entry
> Before your patch:
> 1) X:112 LM:58
> 2) X: 132 LM: 76
> 3) X: 152 LM: 93
> 4) X: 150 LM:91
> After your patch:
> 1) X: 108 LM: 58
> 2) X: 127 LM: 76
> 3) X: 144 LM: 93
> 4) X: 142 LM: 91
> I notice that we consume less memory, that's fine!
> However still after I do "remove all pictures" in LaternaMagica and
> nothing gets displayed, LaternaMagica and X get not back to the initial
> memory usage. Perhaps there is a leak in LM I am not finding? that would
> also explain why the X server doesn't free all the memory.
> Riccardo

reply via email to

[Prev in Thread] Current Thread [Next in Thread]