Re: Allocation profiling

  • From: Tomas Lundell <tomas.lundell@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 20 May 2012 21:28:59 +1000

Not easy, but not very hard either. Here's how I've done it in the past:
Hook the memory allocator and ask the current thread for the call stack.
Create a tree with one node per call stack entry and the number of
allocations using that node (so each allocation increments one node per
call stack level). Dump that to a file and parse it into an expandable tree
view (or you can include the tree view in your profiled program if you're
careful). You now get a top-down view of where the allocations are going
that you can drill down into. It shouldn't be more than about a day's worth
of work.

On Sun, May 20, 2012 at 9:09 PM, Florian Weimer <fw@xxxxxxxxxxxxx> wrote:

> I want to do some allocation profiling, to get a rough idea where
> allocations are coming from (which eventually trigger garbage
> collection).  Is there an easy way to do this?
>
>

Other related posts: