Out of memory (400314)

Hi,

We are having some out of memory problems. We often get an out of memory exception when allocating a color array. It takes about 2-4MB of memory. When checking the Unity process it takes around 1GB of memory (I have total 3GB of an using around 1GB for other processes). Which is the amount of content we have loaded, so that’s as expected. Shouldn’t Unity be able to allocated up to 2GB (and then start swapping)? Also this happens after starting/stopping our project in the editor a couple of times.

So, we are probably not freeing our resources correctly.

So I’m asking for some recommendations on what to do and how to address this problem. Is the best way just to track our resources and make sure they are Destroyed correctly? How do you handle assets and heap memory in your projects?

Thanks,
//ohm

You can start with this script for detecting leaked objects of various types.

–Eric

Ok, I’ll check that out. One question about asset bundles. Should I unload them when I have instantiated the game object? How should I do with textures in asset bundles?

//ohm