x


Tools to profile memory usage

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?

more ▼

asked Mar 15 '11 at 11:38 AM

Leepo 1 gravatar image

Leepo 1
283 8 10 21

Also looking for a memory profile tool for Unity applications

Apr 02 '12 at 11:16 AM theschwartz

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?

Apr 02 '12 at 01:03 PM Bunny83

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.

Apr 02 '12 at 01:22 PM theschwartz

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.

Apr 25 '12 at 09:54 AM Flownerous

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

Dec 18 '12 at 05:41 AM yoyo
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered May 14 at 04:30 AM

yoyo gravatar image

yoyo
6.4k 25 39 84

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x326
x154
x18

asked: Mar 15 '11 at 11:38 AM

Seen: 2598 times

Last Updated: 5 days ago