- Home /
What exactly triggers Out of Memory for android?
Hi there,
My game is currently crashing on android devices, reporting:
W/Adreno-GSL(17972): <gsl_ldd_control:393>: ioctl fd 60 code 0xc01c0934 (IOCTL_KGSL_GPUMEM_ALLOC_ID) failed: errno 12 Out of memory
Clearly, I'm taking up too much space somewhere, but I'd like to know what boundary I'm running into before starting to reduce allocations. When I pull up the device's (Galaxy S3) /System/build.prop file, it mentions heap growth limit of 96 MB, and a heapsize limit of 256 MB. However, when I use the Unity profiler, the total memory reported appears to stay around ~100 MB. If I grab the actual memory usage on android (dumpsys meminfo), it looks like it's taking up ~330 MB of private memory, with a heap size of 162 MB, both of which I didn't think should be possible.
Can anyone give me some better information on what exactly is evaluated to determine I'm out of memory?
Thanks!
I could be wrong, but from what I've seen: You'll know when the game runs of out memory when the device tries to allocate memory at an invalid address, thus throwing a SIGSEGV11 error or similar. Which probably isn't too helpful, but it's a hint. You can run the Unity profiler while running the game on a device to give you better insight on how the memory is being managed. You can also open the editor.log and see if there are any files that are unnecessarily or suspiciously large.
I'm not actually seeing a sigfault -- just the error I listed above. Given that error message, I figured it must be a GPU issue, so I created an empty project that just allowed me to constantly create textures and upload them to the GPU. When that sample finally crashed, it gave the same error. It seemed to be tied solely to Texture memory -- I could keep readable/writable versions of the textures in memory or not (doubling the memory size), but it made no difference on where the crash occurred.
However, I'm most interested in why, after the crash happens, it was considered a crash. The profiler can tell me how much memory is allocated, but it can't tell me why that specific amount yielded a crash.