Recent

Author Topic: Memory and CPU used  (Read 5337 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3826
    • StrumPract is the musicians best friend
Memory and CPU used
« on: June 29, 2011, 06:38:32 pm »
Hello everybody.
I want to know the amount of memory and cpu used by the application.
Is there a way to retrieve that with FPC for Windows, Linux and OSX ?
If not, witch external program could i use to get that (for Windows, for Linux and for OSX) ?
Many thanks.
« Last Edit: June 29, 2011, 06:44:41 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Memory and CPU used
« Reply #1 on: June 29, 2011, 07:01:49 pm »
In Linux, we have various Task Monitors, System Monitors and utilities like HTop or PowerTop.
You can see there number of CPU wakeups from idle state.
You can see there amount of allocated memory and CPU usage of each process.
Those tools are part of distribution or they are in repository.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Fred vS

  • Hero Member
  • *****
  • Posts: 3826
    • StrumPract is the musicians best friend
Re: Memory and CPU used
« Reply #2 on: June 29, 2011, 08:52:01 pm »
Hello Mr Blaazen and thanks for your answer.
The idea was to load in the Lazarus application a external console application and use  AStringList.LoadFromStream(AProcess.Output) method to retrieve the output of the command line prog.

Now witch command line could give me the amount of memory and cpu used by my Lazarus application ? (for Windows, Linux and OS X)

Thanks
« Last Edit: June 29, 2011, 08:55:38 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Memory and CPU used
« Reply #3 on: June 29, 2011, 10:27:24 pm »
I don't know exactly.
You can list processes in Linux using 'ps':
Code: [Select]
ps -AYou can select output using:
Code: [Select]
ps -A | grep firefoxThis command has really many options for output and formating, so type:
Code: [Select]
man psand look in the manual pages.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Fred vS

  • Hero Member
  • *****
  • Posts: 3826
    • StrumPract is the musicians best friend
Re: Memory and CPU used
« Reply #4 on: June 30, 2011, 12:54:30 am »
Hello Mr Blaazen.
Sorry, but what a jungle that ps command.
For example :

Code: [Select]
ps -A | grep miximum
give me :

Code: [Select]
1856 ?        00:05:26 miximum
Ooops, what does that mean ?

And with  man ps, i do not have find how to retrieve the memory usage and the cpu usage...

But, you have understood what i want, step by step we gonna find the solution  ;D

PS: By the way, if it exists a FPC command for that, i m challenger...
« Last Edit: June 30, 2011, 12:57:27 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018