1

I have some memory leaks in my project, it seems like a closure or cycle reference issue, but I only have memory address.

How can I find certain function or closer that causes memory leaky by memory address?

enter image description here

---------Update ---------

Thanks to @DarkDust, the info of memory address is under inspector tab.

enter image description here

ChengEn
  • 91
  • 5

1 Answers1

3

Edit your scheme, select the "Run" section on the left and then the "Diagnostics" tab. Here, enable "Malloc Stack Logging" (you may need to disable runtime sanitizers if this option is greyed out).

Then run your app again. You can now view a stack trace generated at the time a specific memory area was allocated in the inspector.

See for example this tutorial or this one.

DarkDust
  • 90,870
  • 19
  • 190
  • 224
  • Big thanks, I have read the first blog but the second one is what I need! I just realized that the info of memory address is under memory inspector tab. – ChengEn Aug 25 '22 at 01:06