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

Jean SUZINEAU jean.suzineau at wanadoo.fr
Tue Oct 5 14:01:34 CEST 2021

I don't know if it's related, but I experienced a similar problem a few 
years ago.

It's a console dll written in Freepascal and compiled for Win64 and 
Linux (Ubuntu). It uses several threads and uses CheckSynchronize to 
make calls in the main thread.

The dll is loaded and used by a 4gl program (www.4js.com), I think the 
4gl runtime is compiled with Visual C++ on Windows and GNU C++ on Linux.

With recent (a few years ago) Freepascal a similar CPU consumption when 
idle appeared, but only in Windows, not in Linux.

I didn't needed recent functionalities of Freepascal, so a dirty 
workaround for me for this project was to stick to Lazarus 1.6 / 2016 02 
14 / FPC 3.0.0 / SVN 51360 (from menu Help/About Lazarus). I don't have 
the CPU consumption with this version.

More information about the fpc-pascal mailing list