title: Huge memory consumption while parsing JSON and creating NSManagedObjects
body: <p>I'm parsing a JSON file on an iPad which has about 53 MB. The parsing is working fine, I'm using Yajlparser which is a SAX parser and have set it up like this:</p>
  
  <pre><code>    NSData *data = [NSData dataWithContentsOfFile:path options:NSDataReadingMappedAlways|NSDataReadingUncached error:&amp;parseError];
      YAJLParser *parser = [[YAJLParser alloc] init];
      parser.delegate = self;
      [parser parse:data];
  </code></pre>
  
  <p>Everything worked fine until now, but the JSON-file became bigger and now I'm suddenly experiencing memory warnings on the iPad 2. It receives 4 Memory Warnings and then just crashes. On the iPad 3 it works flawlessly without any mem warnings. </p>
  
  <p>I have started profiling it with Instruments and found a lot of CFNumber allocations (I have stopped Instruments after a couple of minutes, I had it run before until the crash and the CFNumber thing was at about 60 mb or more). </p>
  
  <p><img src="https://i.stack.imgur.com/hLoA5.png" alt="CFNumber allocations"></p>
  
  <p>After opening the CFNumber detail, it showed up a huge list of allocations. One of them showed me the following:</p>
  
  <p><img src="https://i.stack.imgur.com/svp3j.png" alt="CFNumber alloc 1"></p>
  
  <p>and another one here:</p>
  
  <p><img src="https://i.stack.imgur.com/0ddxg.png" alt="CFNumber alloc 2"></p>
  
  <p>So what am I doing wrong? And what does that number (e.g. 72.8% in the last image) stand for? I'm using ARC so I'm not doing any Release or Retain or whatever. </p>
  
  <p>Thanks for your help.
  Cheers</p>
  
  <p>EDIT: I have already asked the question about how to parse such huge files here: <a href="https://stackoverflow.com/questions/15932492/ipad-parsing-an-extremely-huge-json-file-between-50-and-100-mb">iPad - Parsing an extremely huge json - File (between 50 and 100 mb)</a><br>
  So the parsing itself seems to be fine.</p>