Recent

Author Topic: CPU usage  (Read 11431 times)

Rickmeister

  • New member
  • *
  • Posts: 21
Re: CPU usage
« Reply #15 on: March 28, 2016, 02:44:08 pm »
Lazarus trunk/fpc 3.0.0 on Fedora Core 18 (32-bit) (VM  hosted on Win7-64).
Lazarus idle hardly gets > 1,5% CPU (minimized or not).

Bart

Doesn't really help me alot  %) I've resigned and installed 1.4.4 as 1.6 is not usable on any of my linux boxes. Not running VM linux installations, not sure if that should make any difference. Tested on both 64 and 32 bit images and with different hardware, and 32 and 64 bit Lazarus builds. Nothing helps, the IDE is sluggish, doesn't respond and crashes frequently

Rickmeister

  • New member
  • *
  • Posts: 21
Re: CPU usage
« Reply #16 on: March 28, 2016, 03:51:13 pm »
Just to clarify:

All Lazarus 1.6 installations where 'out-of-the-box' on fresh linux installations, only the bare minimum installed. I've tried with both the prebuilt rpms and compiled Lazarus from source. Tested on hardware as described in an above post, with both Fedora23 and Ubuntu Mate 15.10 - all yields the same result - an unusable IDE that eats cpu-power (and battery time). I have no clue what may cause this as I'm not a Linux guru. Haven't touched any settings inside the IDE, the only thing I've done is loaded it up and left it to idle with the default project. Never seen it drop below 35% cpu usage.

Handoko

  • Hero Member
  • *****
  • Posts: 3042
  • My goal: build my own game engine using Lazarus
Re: CPU usage
« Reply #17 on: March 28, 2016, 04:53:43 pm »
I saw all of your tests were performed on laptop computers, have you tried to do the same installation on desktop pcs? You mentioned that the issue won't happen on the same machines if they use Win7. So I guess there might be some kind of bug if Lazarus + Linux + laptop combination. You know, laptop's processors are build to better power save, perhaps that power saving feature is the cause of this issue.

Is here anybody use Lazarus on Linux laptop?

Bart

  • Hero Member
  • *****
  • Posts: 3436
    • Bart en Mariska's Webstek
Re: CPU usage
« Reply #18 on: March 28, 2016, 04:56:23 pm »
Fedora Core 18 VM on Win7-64 on a laptop.

Bart

Handoko

  • Hero Member
  • *****
  • Posts: 3042
  • My goal: build my own game engine using Lazarus
Re: CPU usage
« Reply #19 on: March 28, 2016, 05:07:31 pm »
By using Linux VM on Windows machine, it means the power management system is not handled directly by Linux.

If you google using keywords: "ubuntu power management issue", you will see there were several reports of similar issue.

Rickmeister

  • New member
  • *
  • Posts: 21
Re: CPU usage
« Reply #20 on: March 28, 2016, 06:13:18 pm »
I saw all of your tests were performed on laptop computers, have you tried to do the same installation on desktop pcs? You mentioned that the issue won't happen on the same machines if they use Win7. So I guess there might be some kind of bug if Lazarus + Linux + laptop combination. You know, laptop's processors are build to better power save, perhaps that power saving feature is the cause of this issue.

Is here anybody use Lazarus on Linux laptop?

Maybe it isn't just my fault then  :P I've only got laptops, mostly because I travel alot and bringing a stationary computer along with you is just to much hazzle :)

But something must have happened between 1.4.4 and 1.6, the earlier Lazarus versions doesn't have this issue
« Last Edit: March 28, 2016, 06:14:49 pm by Rickmeister »

Handoko

  • Hero Member
  • *****
  • Posts: 3042
  • My goal: build my own game engine using Lazarus
Re: CPU usage
« Reply #21 on: March 28, 2016, 06:22:23 pm »
There could be Linux kernel and power management issue. I think they may ignore you, but for the sake of humanity, you should post a bug report on linux forum.  8-)

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 753
Re: CPU usage
« Reply #22 on: March 28, 2016, 06:30:59 pm »
hello,
my configuration (desktop) with 0 % CPU usage for Ubuntu 14.04 LTS 64 bits Lazarus 1.6   was :   
Processor    :  4x Intel(R) Core(TM)2 Quad CPU Q8300 @ 2.50GHz
Memory    : 6111MB (2304MB used)
Graphic card :  Nvidia GeForce GT 220
Resolution :  1920x1080 pixels

and you Rickmeister, what are your configurations for your laptops ?
« Last Edit: March 28, 2016, 06:36:13 pm by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5391
    • wiki
Re: CPU usage
« Reply #23 on: March 28, 2016, 08:38:06 pm »
There are many who use it on laptop. So power consumption has always been important.

You should try to find out what uses the cpu. Run it in gdb and break a few times, and see what it does. Or run it in valgrind (slow), or any profiler you know.

Rickmeister

  • New member
  • *
  • Posts: 21
Re: CPU usage
« Reply #24 on: March 28, 2016, 09:42:37 pm »
There could be Linux kernel and power management issue. I think they may ignore you, but for the sake of humanity, you should post a bug report on linux forum.  8-)

No other applications has this problem, so my guess is that it's a Lazarus bug. Eclipse Luna uses less CPU power, and I've always thought of that as a CPU hog.

Rickmeister

  • New member
  • *
  • Posts: 21
Re: CPU usage
« Reply #25 on: March 28, 2016, 09:45:25 pm »
hello,
my configuration (desktop) with 0 % CPU usage for Ubuntu 14.04 LTS 64 bits Lazarus 1.6   was :   
Processor    :  4x Intel(R) Core(TM)2 Quad CPU Q8300 @ 2.50GHz
Memory    : 6111MB (2304MB used)
Graphic card :  Nvidia GeForce GT 220
Resolution :  1920x1080 pixels

and you Rickmeister, what are your configurations for your laptops ?

HP EliteBook 8460p
Processor: Intel Core i5-2520M @ 2.50Ghz  X 4
Memory: 3.8 Gig
Graphics card: Intel Sandybridge Mobile
OS: Fedora 23 64bit
Resolution: 1366 x 768

Not a monster by far, but it should be well enough power to run Lazarus

Leledumbo

  • Hero Member
  • *****
  • Posts: 8074
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: CPU usage
« Reply #26 on: March 29, 2016, 08:36:20 am »
I've got both core i3-4200u and core i7-5500u laptops, both running manjaro linux 64-bit and in both lazarus are running fine with near 0% cpu. I even got one running under virtualbox (manjaro lxqt 64-bit), which also consumes near 0% cpu.
« Last Edit: March 29, 2016, 08:44:42 am by Leledumbo »

Rickmeister

  • New member
  • *
  • Posts: 21
Re: CPU usage
« Reply #27 on: March 29, 2016, 11:10:19 pm »
Played around with the lazrus 1.6 source, and when deleting this line in ide/fpmake.pp I finally found it:
Code: Pascal  [Select]
  1. P.Options.Add('-O1');
I'm now satisfied with the IDE. It now runs fine, no locks-ups and the CPU usage is down to 0% when idling. Took me approx 20 rebuilds to get this  :D

[edit] Spelling..... *sigh*
« Last Edit: March 29, 2016, 11:12:06 pm by Rickmeister »

brailateo

  • Newbie
  • Posts: 1
Re: CPU usage
« Reply #28 on: December 20, 2018, 09:05:58 pm »
The same problem to me with: Lazarus 1.8.2 QT5 VERSION + (Ubuntu Mate 18.04 64 bit OR Linux Mint Mate 14 64 bit)
4 cores, one of them is at 100%, working with Lazarus IDE or running the compiled program alone!

The same executable file, moved to a Manjaro 18 64 bit, is working fine, 0.1% CPU only.

I uninstalled the Lazarus QT5 version and replace it with GTK2 version then clean and rebuild the project.
Tadaaaaa, the GTK2 is not eating 100% CPU anymore on Ubuntu Mate 18.04 !

Any ideas?
Thanks
Teo
« Last Edit: December 20, 2018, 09:31:29 pm by brailateo »

lucamar

  • Hero Member
  • *****
  • Posts: 1551
Re: CPU usage
« Reply #29 on: December 20, 2018, 10:20:14 pm »
Any ideas?

Use the standard GTK2 Lazarus? You can build Qt applications with it, if you want. See the wiki for details.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4 & 2.0.2 w/FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.