Memory allocation getting out of control

Hey guys,

So I upgraded the project to Unity 5.3.2f1 in order to fix some some Shrunken related crashes. After doing this I noticed the game would crash at fairly random moments throughout the game. I then decided to run the profiler and start debugging the issue (since the crash logs appeared to indicate memory related crashes). It seems that the only significant increase in memory usage comes from the GfxDriver which consistently increases throughout the scenes (the texture memory actually drops over time, so it seems fairly unrelated).

However there seems to be little information online as to why the GfxDriver memory footprint would increase so dramatically over time / scene transitions. I’ve attached some screenshots of the profiler reports while the game is running, as well as a text log of the crash itself.


Fig 1: The profiler at the start of the game…


Fig 2: …the profiler at the point of the crash.
```
*myGame(6709,0x19f639000) malloc: *** mach_vm_map(size=4210688) failed (error code=3)

*** error: can’t allocate region
*** set a breakpoint in malloc_error_break to debug
Could not allocate memory: System out of memory!
Trying to allocate: 4194304B with 16 alignment. MemoryLabel: GfxDevice
Allocation happend at: Line:62 in ./Runtime/Containers/WrappingRingbuffer.h
Memory overview

[ ALLOC_DEFAULT ] used: 11338843B | peak: 40808412B | reserved: 12691714B
[ ALLOC_TEMP_JOB ] used: 0B | peak: 0B | reserved: 524288B
[ IOS new_delete ] used: 0B | peak: 0B | reserved: 0B
[ ALLOC_GAMEOBJECT ] used: 3614316B | peak: 3875194B | reserved: 4128854B
[ ALLOC_GFX ] used: 119929B | peak: 378978B | reserved: 126408B
[ ALLOC_PROFILER ] used: 155446404B | peak: 155447748B | reserved: 156264525B
Could not allocate memory: System out of memory!
Trying to allocate: 4194304B with 16 alignment. MemoryLabel: GfxDevice
Allocation happend at: Line:62 in ./Runtime/Containers/WrappingRingbuffer.h
Memory overview

[ ALLOC_DEFAULT ] used: 11338843B | peak: 40808412B | reserved: 12691714B
[ ALLOC_TEMP_JOB ] used: 0B | peak: 0B | reserved: 524288B
[ IOS new_delete ] used: 0B | peak: 0B | reserved: 0B
[ ALLOC_GAMEOBJECT ] used: 3614316B | peak: 3875194B | reserved: 4128854B
[ ALLOC_GFX ] used: 119929B | peak: 378978B | reserved: 126408B
[ ALLOC_PROFILER ] used: 155446404B | peak: 155447748B | reserved: 156264525B

(Filename: /Users/builduser/buildslave/unity/build/Runtime/Allocator/MemoryManager.cpp Line: 982)

(lldb)
_
```*_
Fig 3: The crash log.

Try using the latest patch version 5.3.2p2. 5.3.2f1 had some particle bugs.

Hi Karl,

We actually upgraded to this yesterday hoping it would resolve the issue but to no avail. Just to clarify there doesn’t seem to be an issue with particle effects anymore, we just had to upgrade to 5.3.2f1 previously because the editor was hammering us with particle errors. They’re gone now but in their place are the constant crashes!

Can you submit a bug report with a sample project?