|
The unity 3(.3) profiler does not help me profile my scripts memory usage since it only shows the total memory usage. Furthermore, so far the (.NET) memory profiling tools I've tried all don't work for Unity games. What tools can be used to profile memory usage?
(comments are locked)
|
|
As of Unity 4.1, Pro version, the best solution is the Memory Profiler, first introduced in this blog post. For Unity Free, you could use Resources.FindObjectsOfTypeAll to see what you have loaded. It won't find every little allocation, but at least you can track down the big ones -- textures, audio clips, meshes, etc. Or try searching the Asset Store for memory profiling tools.
(comments are locked)
|

Also looking for a memory profile tool for Unity applications
I'm not sure what you actually want the profiler to display. Every object has some kind of memory usage and that is its member variables. Referenced objects can't be count for a certain class instance since multiple instances can hold the same reference. So every object is on its own.
Most objects are placed on the heap and don't belong to the creator object. They just eats up memory but you can't refer to a specific Unity script which might have created the instance.
So what kind of view / display do you want / expect?
It would be nice to get a fragmented overview of the Unity application's memory usage. My company is having problems figuring out what the application's memory is used on. Our application uses 1.6GB and there is about 1GB we can't account for. Is it used on Unity assets, Mono objects or something totally different? It is hard for us find out easily.
Yeah it's always useful to be able to track each individual allocation and the call-stack when it was allocated. Currently seeing a 700 kB allocation every few seconds in my game but I have no way of profiling for it.
Mono supports at least parts of the System.GC (garbage collector) interface, which might be helpful, though it won't tell you about unmanaged allocations inside the Unity engine. More details here -- http://msdn.microsoft.com/en-us/library/system.gc_members(v=vs.90).aspx