Skip to content

New tutorial: Profiling memory with TheMiner

July 11, 2012

Tutorial: Using the Memory profiler

Most of the time, Flash performance issues come from bad memory management.
Object instantiation take a lot of time, and since FlashPlayer work with a Garbage Collector, having tons of objects can make it go nuts.
Good practice is to remove all instantiation from loops, keep a minimum of object in memory and use serialization and bytearrays to keep some data.

This profiler show you what the VM is reporting as object being allocated and removed (garbage collected).
Here is what the profiler look like:


1. Search filter

Since there is a lot of different object type being managed by the VM,
just listing them would make it hard to find specific data.
This input box let you enter any text to filter the visible object using their QName

When the filter search is ON (there is text inside the box), the box appear green,
and only class name with the text in it appear in the list.


2. Class QName

The QName is the ClassName with its full ClassPath. the format is ClassPath::ClassName
3. Avg new / frame

When profiling memory, high number of instantiation might be harder to understand.
Having an average instantiation per frame let the developer understand the exact amount of allocation in a single frame


4. Sample snapshot

The miner cannot guess all the post-analysis you want to do.
But it does offer you a easy way to save data in a grid format that can be pasted directly in excel
If you need to save the current state, or do graphics using the data in the profiler,
you can use the snapshot button to copy all class to the clipboard with all their numbers.


5. Clear all samples

Reset the current instance count and cumulative instance count for all class.

6. Pause refresh

Toggle button that keep retrieving sampling data, but stop the interface refresh.

7. Added per second(default refresh-rate)

Number of Class instantiated in one second The default refresh rate can be change in the configuration tab

8. Deleted per second(default refresh-rate)

Number of Class being collected by the GC in one second The default refresh rate can be change in the configuration tab

9. Sort by Current Instance Count

Sort by Current Instance Count

10. Current Instance Count

The current instance count is calculated by removing Collected Sample to New Sample.
This number is significant only when the memory profiler continuous profiling is turned-on in the configuration tab
because all sample report must be processed in order to have a good count.

11. Sort by Cummulative Instance Count

Sort by Cummulative Instance Count

12. Cummulative Instance Count

The total number of Instanciation for a given class type.

 

Try TheMiner!

 

 

 

About these ads
2 Comments
  1. Kean permalink

    I’d love to use the memory profiler, but on opening it, it’s entirely blank. :/ The flash application is running fine, though, debugger version and all.. any idea how that could be?

Trackbacks & Pingbacks

  1. New tutorial: Profiling memory with TheMiner « eaflash

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 33 other followers

%d bloggers like this: