Re: Memory leak in Apple's image handling frameworks ?
Re: Memory leak in Apple's image handling frameworks ?
- Subject: Re: Memory leak in Apple's image handling frameworks ?
- From: Rob Petrovec via Cocoa-dev <email@hidden>
- Date: Sun, 30 Apr 2023 12:41:43 -0600
Oh yeah, Gabriel, another technique you can use is to start your app and create
a memgraph _before_ reproducing the problem. Then reproduce the problem and
run ‘heap MyApp --diffFrom MyApp.memgraph’. It will show the new objects that
have been created since the memgraph was taken, sorted number of objects. That
might narrow down what object(s) are eating your memory. Good luck.
—Rob
> On Apr 30, 2023, at 12:31 PM, Rob Petrovec via Cocoa-dev
> <email@hidden> wrote:
>
> Hey,
> Since you have unbounded memory growth, you will likely have one or
> more object types with a TON of instances in the list on the left. They are
> likely the source, or part of a chain of objects eating your memory.
> MallocStackLogging doesn’t show more info about a possible cause. Once you
> find the cause (the object type(s) eating your memory) MallocStackLogging
> will show you where those objects are being created and you can inspect their
> retain/release history to see where you may be forgetting to release
> something. Memory issues are not simple to track down, but once you do find
> the cause they are totally satisfying when you find a fix. Good luck.
>
> —Rob
>
>
>> On Apr 30, 2023, at 9:41 AM, Gabriel Zachmann <email@hidden> wrote:
>>
>> Thanks a lot for your response!
>> And thanks a lot for your hints to 'leaks'.
>>
>> I tried it, but I don't see any "ROOT CYCLE" in the output of 'leaks'.
>> (I see a bunch of ROOT LEAKS, but in total it's just 6 kB.)
>>
>> Also, in the Debugger of Xcode, when i click on "Debug Memory Graph" icon, I
>> get lots of graphs, but none of them shows a cycle.
>> Same when I double-click the memgraph file: I can select all the memory
>> graphs that go through CGImage, but none of them contains a cycle (and most
>> of them don't originate in my code).
>>
>> And, yes, I do release the images using CFRelease() - but, of course, still
>> thanks for the thought!
>>
>> ( I also switched on MallocStackLogging, but that did not provide more info
>> on potential causes for the massive leak, of course.)
>>
>>
>> Still stymied, Gab.
>>
>>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden