I didn’t find any reference or API or any thread in forum about it [correct me if I missed it].
We can get the VRAM info in Editor and others also, but we can’t get any info about how much memory it’s eating when running the game in iPhone or how much memory it’s freeing when moving one scene to another. This is very important because I need to know my game memory consumption [VRAM and System RAM].
You can use XCode tools to figure it out. Once you’re in the XCode with your project loaded, choose Run | Start with Performance Tool | Activity Monitor. You can find information like how much memory or CPU your app takes.
When I used Leak Instrument in my application then I found that I’m leaking memory. Then I tried with StartTrooper the example project of Unity. And it’s also detect the Memory.
Here is an attachment of the screen shoot. Can anyone explain why?
16 bytes per frame?? Not using rigidbodies?? Not even triggers work without rigidbodies so it’s kind of difficult to get much going without using rigidbodies.
I have to say I’m getting less and less impressed by the day with using Unity for iPhone dev. Performance is low and with leaks like this it’s not very encouraging.
Don’t get me wrong, I love much about Unity but for iPhone dev it’s getting closer and closer to a no go…
cbman, I would like to know what other game engine available for iPhone is even close to Unity? Performance is low? Have you all looked at the Warehouse/occlusion culling demo? It’s perhaps the best 3D I’ve seen on the iphone and it plays very smoothly.
By my estimate @ 30fps 16 bytes per frame is ~ 1.7MB leaked per hour. That sounds like a lot but how often does a game get played for an hour on an iphone, before getting quit restarted? Also actual framerates will be somewhere between 15 and 30 fps so the number is smaller. This leak is certainly not a showstopper for my game.
Anyhow, I am curious if setting all rigidbodies to kinematic effectively turns off PhsyX? Probably not. I guess I can load up the tool as described by Rej to try and see.
dreamora- OK I guess I don’t understand. The iphone OS has protected memory because it is based on Darwin/OSX, right? If so then how can leaked memory persist until the device is rebooted? Maybe someone can link to an article or something where this is explained. Thanks
On the how you will have to ask Apple.
Fact is that all gamer have to restart their device at least once per day due to low memory problems. Same is normally recommend after installs.
Until that problem with “blocked RAM” is solved, any other leak that does not kill the game during runtime is not of considerable interest, at least to me as my own leaks are a minimal problem compared to the twice per day restarts I need to do to play simple TD games as they otherwise just “leave” the game back to desktop
None that I know of, and there is the dilemma. There are, as pointed out in other posts, some other engines but not with the ease of use Unity offers. And I could of course write it all from scratch and take useful parts from past games I have done but creating an engine takes just as much time as creating a game and I really don’t want to spend a year on a game that will sell for $1.99 or so…
True that is a good demo. But that’s the thing, it’s a demo, not a game. I can get decent performance with a static structure, that’s not the problem. With only about 20 draw calls you are very limited to what you can have going on on the screen. And it seems it’s the number of draw calls that really grinds it to a halt. Even with only about 2000 vertices, it comes to a crawl when the draw count goes up.
And the bloat of the runtime is not a plus either. If it uses about 20 Mb of memory just for the Unity engine stuff when the app runs, that’s not exactly good. And getting it on the app store below 10 Mb seems to be pretty much impossible.
So at this point I really don’t know… Looking at some games running on the iPhone, it is possible to do some pretty cool stuff but I don’t see how it could be done with Unity in it’s current state. I will still try a few more things tho…
And paying close to 3K just to be able to swap out the Unity splash screen and not really gain anything else does not seem too appealing with all the above taken into account.
I don’t think only 16byte for PhyX. You can try it using Xcode instruments. I found sometimes it’s leaking 1024 block also where I have no RB, no Collider and no Phy things, only GUITexture and GUIText.
Xcode leak gave the info that, memory is leaking from Shader:subclass. So, I’m afraid about release a game with such kind of problem.
Man, this will ruind all of the future developemnt based on Unity iPhone.
@seon or anyone: is it possible to leak memory from bad javascript code? I am calling Destroy on unused gameobjects, and calling Application.GarbageCollectUnusedAssets periodically. So other than that, my game’s leaking I cannot control, correct?
@cbman well your position is clear- I can’t argue with what you said except [quote]
creating an engine takes just as much time as creating a game
[/quote] maybe you should be in the game engine business
Mindlube: Unity does a great job of cleaning up stuff for you, but the areas where you need to be careful are when you are creating instances of materials ect in your own code, like:-
var : mat : Material = new Material();
You need to make sure you clean up those instances yourself.
I generally set elements I create myself to null at the end of their use, as a precaution, like WWW instances.