Memory profiling for fun and profit

submited by
Style Pass
2021-08-18 11:00:07

If you'd like to follow along this example check out the simulation directory in the root of the profiler's repository where you'll find the program being analyzed here.

We use the built-in scripting capabilities of the profiler for analysis here (which is available either through the script subcommand of the CLI, or through the scripting console in the GUI), however you can also use the built-in GUI to achieve roughly similar results. This example is more about demonstrating the mindset you need to have when analyzing the data in search of memory leaks as opposed to a step-by-step guide which you could apply everywhere.

It definitely looks like we might have some sort of a memory leak here, but we can't see much on this graph alone due to all of the noise.

Looks like we have a few potential leaks here. First, let's start will defining a small helper function which will graph all of the allocations coming from that one single backtrace, and also print out that backtrace:

Leave a Comment