How to get info of available heap memory?
-
Hi,
I am running an application on Raspberry pi.
Now I would like to be save that there is no OOM (out of memory).
Is it possible to get info of application's available heap memory?Kind regards,
MHermann -
@J-Hilk said in How to get info of available heap memory?:
but that only gives you the potential available memory
Potential available memory is not very helpful.
I either need to know the used memory or the available memory.
I want to print out the values in a logfile, so that I can check the logfiles after crash.So could be a way to do a (unnecessary) malloc, check the return and directly free it?
But this solution seems not to be very nice... -
@J-Hilk said in How to get info of available heap memory?:
but that only gives you the potential available memory
Potential available memory is not very helpful.
I either need to know the used memory or the available memory.
I want to print out the values in a logfile, so that I can check the logfiles after crash.So could be a way to do a (unnecessary) malloc, check the return and directly free it?
But this solution seems not to be very nice...@MHermann well I did some more research for you,
seems like there is https://libstatgrab.org a cross platform c library, that gives feedback about the system status
available memory free memory and used memory among them.
-
Hi,
I am running an application on Raspberry pi.
Now I would like to be save that there is no OOM (out of memory).
Is it possible to get info of application's available heap memory?Kind regards,
MHermann@MHermann said in How to get info of available heap memory?:
Hi,
I am running an application on Raspberry pi.The subtleties of any answer is also going to depend on the operating system, rather than merely the hardware platform.
I either need to know the used memory or the available memory.
As of when? Presuming a multitasking operating system, any information about the state of the system is likely stale for anything but the highest priority task in a hard realtime system.
-
@MHermann well I did some more research for you,
seems like there is https://libstatgrab.org a cross platform c library, that gives feedback about the system status
available memory free memory and used memory among them.
-
@MHermann said in How to get info of available heap memory?:
Hi,
I am running an application on Raspberry pi.The subtleties of any answer is also going to depend on the operating system, rather than merely the hardware platform.
I either need to know the used memory or the available memory.
As of when? Presuming a multitasking operating system, any information about the state of the system is likely stale for anything but the highest priority task in a hard realtime system.
-
@MHermann well I did some more research for you,
seems like there is https://libstatgrab.org a cross platform c library, that gives feedback about the system status
available memory free memory and used memory among them.
@J-Hilk said in How to get info of available heap memory?:
@MHermann well I did some more research for you,
seems like there is https://libstatgrab.org a cross platform c library, that gives feedback about the system status
available memory free memory and used memory among them.I donwloaded statgrab, compiled and installed it.
Now I would like to use it in my source code, but I get following error message after compilation:libstatgrab.so: file not recognized: file format not recognized
I have to cross compile it for Raspbian buster.
I did following:./configure --host=arm-linux-gnueabihf --prefix="/xxx/statgrab" make sudo make install
But it seems to be wrong.
Any ideas what I did wrong? -
@J-Hilk said in How to get info of available heap memory?:
@MHermann well I did some more research for you,
seems like there is https://libstatgrab.org a cross platform c library, that gives feedback about the system status
available memory free memory and used memory among them.I donwloaded statgrab, compiled and installed it.
Now I would like to use it in my source code, but I get following error message after compilation:libstatgrab.so: file not recognized: file format not recognized
I have to cross compile it for Raspbian buster.
I did following:./configure --host=arm-linux-gnueabihf --prefix="/xxx/statgrab" make sudo make install
But it seems to be wrong.
Any ideas what I did wrong?@MHermann see here for a very similar question:
https://forum.qt.io/topic/109732/so-format-not-recognized@JonB is very spot on with his post
-
@MHermann see here for a very similar question:
https://forum.qt.io/topic/109732/so-format-not-recognized@JonB is very spot on with his post
-
@J-Hilk said in How to get info of available heap memory?:
@MHermann well I did some more research for you,
seems like there is https://libstatgrab.org a cross platform c library, that gives feedback about the system status
available memory free memory and used memory among them.I donwloaded statgrab, compiled and installed it.
Now I would like to use it in my source code, but I get following error message after compilation:libstatgrab.so: file not recognized: file format not recognized
I have to cross compile it for Raspbian buster.
I did following:./configure --host=arm-linux-gnueabihf --prefix="/xxx/statgrab" make sudo make install
But it seems to be wrong.
Any ideas what I did wrong? -
@MHermann said in How to get info of available heap memory?:
I have to cross compile it for Raspbian buster.
I am not an expert, but isn't RPi arm64 architecture rather then x86/x64?
-
@JonB: Yes , right.
I thought I can configure this by./configure --host=arm-linux-gnueabihf
But that seems to be wrong.
-
@MHermann
I wouldn't know, but I think this would explain the
libstatgrab.so: file not recognized: file format not recognized
message, if that is an x86/x64 file on an arm_64 platform, that was all.