gnustep-dev
[Top][All Lists]
Advanced

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

Re: memory leak - cairo/x11 backend


From: Riccardo Mottola
Subject: Re: memory leak - cairo/x11 backend
Date: Sun, 22 Dec 2013 19:58:37 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:25.0) Gecko/20100101 Firefox/25.0 SeaMonkey/2.22

Hi,

Thanks for taking a look at it.

Fred Kiefer wrote:
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
method)
Fine, I just moved those calls as you suggested.

I pointed out to two memory leaks: not only the Xorg doesn't get back to its original memory usage, but also LaternaMagica itself: in the example I went from X: 108 LM: 58, to X: 142 LM: 91. That is about a 35MB increase for the server, but also a 33MB increase of LM! Thus I see a problem on both sides, let's analyze LM, perhaps the problem is there and now the Xorg problem is a reflection of that.

You didn't find anything obvious, I too tried the memory panel without success. At start, I see no NSImageViews! why?

Clicking on an item yields
2013-12-22 18:47:19.268 LaternaMagica[14382] Problem posting notification: <NSException: 0x8127f00> NAME:NSRangeException REASON:Index 11 is out of range 0 (in
'objectAtIndex:') INFO:{Array = (); Count = 0; Index = 11; }

Anyway, at start I see:
NSBitmapImageRep: 12
NSImageView: ?
NSImage: ?

I load an image, while displaying it:
NSBitmapImageRep: 34
NSImageView: 1
NSImage: 193

I remove the image (do not "delete" it while testing :) )
NSBitmapImageRep: 33
NSImageView: 1
NSImage: 192

I don't know the original state, but it went back of one, so Indeed something get released, but is it enough?

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 will check that, it looks I desperately had some redraw problems. That code needs to work both inside a window and with a full-screen window. Perhaps it is not needed anymore, I will check on Mac and GNUstep. However, you say yourself that it shouldn't cause memory problems. At most, it is inefficient/inelegant.


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

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.

Fred

Riccardo




reply via email to

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