title: Objective-C - How to force low memory on iOS simulator
body: <p>I have an error that some users are having of <code>EXC_BAD_ACCESS</code> when their device is low on memory. The stack trace is pointing to the <code>if</code> line below, and I believe it's because of the UTF8String that's being deallocated and still being used:</p>
  
  <pre><code>dispatch_sync(dbQueue, ^{
      if (sqlite3_bind_text(sql_stmt, 1, pid.UTF8String, -1, SQLITE_STATIC) != SQLITE_OK) {
  ...
  </code></pre>
  
  <p>I'm having a hard time reproducing the issue on my end, how can I force or simulate low-memory on the simulator or a device?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I've tried adding a breakpoint to the line above, and then using the option Simulator -> Simulate Memory Warning, but I still can't reproduce the EXC_BAD_ACCESS error.</p>