I’m currently seeking for a solution to profile the memory usage with an ingane display. The Profiler may help, but I can’t reda out of the documentation if I could use it in my game or if it is only usable in the editor.
Has someone ever tried to do something equal? Maybe I could do something like this in xCode?
Well, as described, I want to have an ingame display for this. The purpose of this is that I want to give the game to my client and he doesn’t know anything about profiler, debugger, xCode or something, nor does he have Unity. But I want to show him the allocated memory as well as the current FPS (which I have already), so he knows if he could add another bunch of textures into the game or not.
Profiler class can output to logfile which should have all the same info as is editor but doubt you can have access to profiler variables from scripts. Kludgey way could be to parse and tail the logfile every few secs for the wanted values and display em. You can also get whole process mem usage with xcode and objc.
the only way to get an ingame graph is using a standalone profiler that outputs it there like perfhud from NVIDIA does it for rendering stuff. Unsure though if there is such a technology for memory as you don’t need that stuff in realtime commonly as with graphical optimizations that are crucial as graphics power between good and bad machines is on the order of a magnitude+ (RAM for bad machines is still on 2GB+)
you can not fake and predict ram usages yourself reasonably if thats what you hope for as the raw data sizes do not related to actual memory usage of the internal / dx ram managed data etc
@Ostwind: Yeah, that came to my mind too and I think I give it a try.
@Dreamora: Ok thanks. Then I have to try to get the best out of the information I get from the profiler. As my last app crahes occasionally (though the xCode profiler shows a memory usage of 70mb) I think it’s maybe a plugin which consumes all memory and crashes my app. For that I would like to have the information all the time ingame shown as it would also show my client not to use every plugin which he can find
Well 70mb is a lot if you keep in mind that you have 100-120MB available and that those 70MB don’t cover the VRAM that also has to fit into those 100-120mb so look at the unity profiler (in the editor) and look at the estimated texture memory too