Filtering

Filtering overview

Filtering of memory operations is one of the highlights of MTuner. During the execution of your application there may be a very large amount of memory operations performed and in many cases there is a need to identify only a specific subset of them. There are numerous possibilities and it all comes down to your specific needs. One, for example, may be interested in finding more information about memory operations that take place during a loading phase in your application or maybe memory operations that result in blocks of size smaller than 128 bytes, etc. Using filtering isolating this and much more becomes a very simple task.

Filtering can be toggled on and off using the toolbar button. Once filtering is enabled the capture views will reflect the currently set filtering options. For example, the operations list will display only the memory operations that pass all the filters.

Filtering process

There are currently four different ways to filter memory operations. Each of them can work independently or they can be combined, which is done automatically. Below is the list of all filtering options along with more details:

  • Memory timeline
    This is the most powerful way to filter memory operations based on the time of occurrence. Once a portion of time in the graph is selected the capture views will be automatically updated. Using this method of filtering it is easy to select only the operations that happen is certain phase of your application. Knowing how your application operates will help you recognize the patterns in the graph and select the time slice accordingly. If you need more precision then it is recommended to use memory markers and manual instrumentation.

  • Memory histogram
    The histogram provides another way of filtering memory operations, based on their size. Clicking on a bar in the histogram view will activate the filter for memory operations that have size not greater than the value below that bar and not smaller then the value from a previous bar. For example, clicking on a 512b bar will select all memory operations that have size between 257 and 512 bytes. To deactivate the histogram filter just click on the same bar again.

  • Memory heaps / allocators
    Memory heap filtering works by filtering out memory operations with currently selected heap / allocator. Deactivating memory tag filter is done by selecting the ‘All allocators/heaps’ item.

  • Memory tags
    Memory tag filtering works by filtering out memory operations with currently selected memory tag. Deactivating memory tag filter is done by selecting the root tag.

The ability to combine filters brings a powerful ability to identify a variety of allocation patterns. For example, if you want to find what code does most temporary allocations in your run time or maybe where the tiny allocations during loading come from, now it’s a matter of a few clicks and you can have a comprehensive list of all spots to fix in your code base.