I coded a simple picture viewer which just slides randomly through pictures in ~/Pictures
.
For each new transition, I am creating and loading the NSImage
, then create a new NSImageView
and set it as a new subview and the old subview is removed.
This is basically all. The memory is constantly raising with every new picture and I wonder why. I would have expected that it would stay very low and always mostly constant.
I tried to debug it and the profiler tool doesn't find any leaked memory, so I guess it is still referenced or more complicated. Most memory is taken from the function ImageIO_malloc
, though.
The full (relevant) code can be seen here (much simplified already -- most of the functionality removed, however the leak remains).
ARC is disabled.
The interesting bit: When I disable the ObjC GC, it is as expected. It stays (relatively) low.