Memory management using Cocoa frontend for Unity application

Hello, All!

We’re developing the game that uses a Cocoa frontend for menu and Unity for the game itself like described here.

There is a strange problem with “Program received status 0” message in the combined code, that doesn’t appear in the separate projects itself, in the menu only or in the unity only project.

Search on forums suggests that it is a “not enough memory error”.

The free memory measurer from here shows that there is about 30 megs after the frontend starts, about 14-16 megs free is left after the unity itself starts and loads a bummy scene, and there is only 1-4 megs left after the actual scene is loaded first time. However, after the scene is unloaded, the memory seems to be cleaned because the free mem shows the same 14-16 megs in the log. Strangely, the attempt to load the actual scene second time causes the “Program received signal 0” message and app quits.

However, the removal of big textures from the scene resolves the error, also causing a bad image quality, which rises the following question:

Does anyone know how to measure the texture memory, used by unity and cocoa, and how to measure the program memory used?

Also, any comments on the process in whole?

The only way to measure the actually used, not pool reserved, memory is through System.GC

As for the texture memory: the opengl es tools, if they feel like working, should help on that end.

Thanks for your advice, dreamora, i’ll try that.
There is a good tutor about memory there:

http://gamesfromwithin.com/whered-that-memory-go

But i’m still searching for the code like this to check the video ram.

I’m sorry I have to bump this old post, because I am wanting to know, what is this difference between ‘actually used memory’ and ‘pool reserved memory?’

Does the memory watcher instrument in xCode not report the total memory used currently, but rather, the pool of memory Mono has taken up that could be used, and then System.GC.something reports the actual memory usage by Unity? Or something like that? How do you see actually used memory through System.GC?