Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Is there a way to release Mono memory on iOS?

Discussion in 'iOS and tvOS' started by Paulius-Liekis, Jan 16, 2016.

  1. Paulius-Liekis


    Aug 31, 2009
    Has anyone found a way to release Mono memory in iOS app? I know a few ideas:

    1. Wrap Unity app in native app. That is possible, although you can not release Unity app anyway, thus you can not release Mono heap.

    2. Do something on IL2CPP level. In theory IL2CPP operates in native level, so in theory you could allocate some objects yourself and then release them on demand. I know that it's possible to do that using plugins, but that puts to big barrier between native code in IL2CPP generated code. Has anyone knows a way to do it on a more native level?
    My case: I have an app which is needs a lot of memory (maps application). I need the app that app to run in the background for GPS recording. So I need to be able to release majority of allocated memory when that is requested by iOS.

    PS.: I don't have memory leaks and I'm pooling my objects already. I actually have high memory consumption which I need to release on a request from iOS.