[fpc-pascal] My Linux service application consumes 10% CPU when idling - why?

Bernd K. prof7bit at gmail.com
Sat Oct 23 12:46:21 CEST 2021


Am 07.10.21 um 19:41 schrieb Bo Berglund via fpc-pascal:

> The question is: how to find what is still using CPU? 

Have a look at the tool sysprof. This is a statistical sampling profiler 
that can show you a call tree with percentages of CPU consumption. Thee 
are also other sampling profilers around (oprofile, perf/hotspot, 
google-gperftools, etc..) that all work by the same principle, you could 
try which one suits you best. They should all be able to tell you where 
exactly it spends how much of its CPU time. You don't need to instrument 
the code, just compile it with dwarf debug info contained in the 
executable (not as external debug file), maybe also reduce the 
optimization level if, and it should be able to show you the call tree 
along with time consumption of each function.

Bernd




More information about the fpc-pascal mailing list