0

I had changed nothing in my program, Xcode suddenly gives me a crash :

app(1010,0x1112783c0) malloc: *** mach_vm_map(size=281036240113664) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
app(1010,0x1112783c0) malloc: *** mach_vm_map(size=421554360172544) failed (error code=3)
*** error: can't allocate region

I started to add return; in the code , to find the right spot. Turned out, there are few completely different things that cause this , non of them had been changed in the last month.

One of them, which had never made me any problem is :

  var data = [[String:String]]()
  let dictionary1: [String: String] = ["IMAGE": "motor.png","TITLE":"motor","SUBTITLE":"-"]
  data.append(dictionary1)  //  ******** crash is here !

My intuition says its not really where the problem is, and I can not find a way to solve this.

Tried to reboot, get to a previous version, nothing .

How can I find what it is ?

Curnelious
  • 1
  • 16
  • 76
  • 150
  • 1
    Looks like a memleak (which eventually causes the malloc failure). I don't believe anyone will give you any better advice than in the answers of the two dupes I've marked for you (as you'd need to perform the profiler analysis by yourself, in the end, for your specific application). 3rd party libs could always be a red flag in case you can't find an obvious memleak / memory waste in your own code. – dfrib Mar 07 '17 at 21:08
  • Following answer could help http://stackoverflow.com/a/5823136/912822 – ldindu Mar 07 '17 at 22:05

0 Answers0