Is the Unity 3.0 editor memory profiler full of lies?

I’m trying to figure out if I am just chasing my tail here or not but I recently upgraded to a pro licence and am using the editor profiler for the first time. My game is showing an absurd amount of memory being allocated during very simple scenes along with around 7000 objects in a scene with less than a dozen transforms in it to my knowledge. As my game runs I’ve had the profiler show as much as half a gig of memory allocated and almost 50,000 objects. I don’t see how that could possibly be accurate. If I enable the internal profiler and run the game on an iPhone I see a 3-4mb heap. This leads me to believe that the editor profiler is full of lies but I wanted to verify this before I completely ignore it.

Thanks!

objects are all objects, not just 3d objects

also half a gig sounds reasonable cause unity itself likely is already eating 250-350mb++ depending on the assets in your project

You should use the memory profiler as a rough, rough, rough guide. It’s more to see where you’re allocating etc than to get specific figures from.

As far as I know the profiler is accurate. It looks like I get consistent results with the profiler compared to running a standalone and looking at the memory with Activity Monitor, given that a standalone has less overhead (since the entire editor isn’t running).

–Eric

I think he’s comparing it to memory consumption on the iPhone itself… Obviously, using 500mb is impossible on the device.

However, code gets compiled, various libraries aren’t used, etc etc…

unhappily, if you take the memory before start as 0 point, the data is not that far off.

for example, loading textures throug LoadImage or from WWW really bombs up the RAM as I had to find out (bug already reported), with a mere 14 480x340 images crashing out an iphone app on a 3GS, which at start of execution had 160mb+ free of its ram

I would strongly encourage to use either Xcode tools (a grain of salt should be put there as well) and the internal iPhone profiler (explore appcontroller.mm to find it) for iPhone app profiling.

Unity profiler shows you the desktop performance, it does not emulate iPhone.

I suppose that it will not be easy but getting actual device performances in the profiler window would be great.
I now have a performance drop after switching to Unity AND iOS pro and can’t nail this rendering issue.
Performance dropped after switching from iOS to iOS pro…

I’ll try (do or do not, there is no try)… I’ll use the Xcode tools but none of them allow rendering monitoring.

actual device performance can be gotten from the actual device instruments in xcode. Thats what they are for and why apple enforces osx actually :slight_smile:

(learning them is not optional but mandatory as is learning to interpret crash logs and gdb errors)