2

At app start, my Cocoa app instantly creates two CFData objects. One of size 34 MB and another of size 57 MB. I cannot seem to figure out what these objects are or where they are coming from within Instruments.

Instruments

Both are allocated before applicationWillFinishLaunching completes.

I have tried clearing NSURLCache as well as clearing my Kingfisher image cache and am open to other ideas for cleaning out this data. How can I find the source of these allocations?

Andrew Schreiber
  • 14,344
  • 6
  • 46
  • 53

1 Answers1

0

The issue turned out to be caused by NSUserDefaults. Earlier in development, I had saved some large files there, which were never deleted.

Here is what the Instruments call tree revealed.

Stack Trace

From there I tried using

NSUserDefaults.resetStandardUserDefaults()

But that did nothing. Nor did cleaning my project or deleting the Derived Data folder manually.

Following this answer brought my CFData allocation to zero: Clearing NSUserDefaults

Community
  • 1
  • 1
Andrew Schreiber
  • 14,344
  • 6
  • 46
  • 53