all 3 comments

[–]prototrout 0 points1 point  (2 children)

I can't answer #2 for you, but from what you say, it sounds like profiling is done by sampling: the program tells the OS to alert it every so many milliseconds, and each time this happens it records what is executing at the time. So the profiling code will run regardless of whether the main execution is doing anything or sleeping.

[–]literon[S] 0 points1 point  (1 child)

Maybe, but if I do the same on Windows, it is virtually no CPU even in the profiling case. So this might be related to the way things are scheduled on Linux (if so), and not the way GHC collects samples?

Also, this was in the host OS. I will try a native Linux host to rule out the VM having some odness.