GHC Heap Profiler time axis

Hello, Haskell-Cafe! For the last 2 days I’m debugging something that looks like a space leak. My program is a rather long-running network service. When I first used heap profiler I was a bit confused with its output that showed that my program was running for only about 0.3-0.4 seconds when I launched it idling for about a minute. That was confusing enough for me to dig into GHC sources trying to figure out the reason behind this and I found that values of the sample times are taken from the mut_user_time function, which returns a time that process spent in user-mode code (outside the kernel) minus time spent on garbage collection. This introduces great amount of unpredictable non-linearity of the heap profile graph x axis, which I personally consider very counterintuitive. So my question is does anybody know why is it done this way? Wouldn’t it be better if x axis would just show a time elapsed since the process started? Kind regards, Anton.

On 12/19/2014 03:46 PM, Anton Dessiatov wrote:
Hello, Haskell-Cafe!
For the last 2 days I’m debugging something that looks like a space leak. My program is a rather long-running network service. When I first used heap profiler I was a bit confused with its output that showed that my program was running for only about 0.3-0.4 seconds when I launched it idling for about a minute.
That was confusing enough for me to dig into GHC sources trying to figure out the reason behind this and I found that values of the sample times are taken from the mut_user_time function, which returns a time that process spent in user-mode code (outside the kernel) minus time spent on garbage collection.
This introduces great amount of unpredictable non-linearity of the heap profile graph x axis, which I personally consider very counterintuitive.
So my question is does anybody know why is it done this way? Wouldn’t it be better if x axis would just show a time elapsed since the process started?
Kind regards, Anton.
ghc-user or ghc-devs lists may be more appropriate for this question. I am eager to find out myself. -- Mateusz K.
participants (2)
-
Anton Dessiatov
-
Mateusz Kowalczyk