We have a C/C++ application which reports appr. 450 MB resident memory usage when started (using htop’s RES column). It seems that this memory footprint is reduced to below 400 MB when other processes consume a lot of memory. This is pretty unexpected for us, since the application doesn’t use a lot of dynamic memory when running (except for some c++ objects like std::strings, which are small).
There is a suspicion that this is related to CUDA usage.
The relating questions are the following:
Is it possible to see the amount of memory of a process which would be freed up in low memory situations in tools like htop or with a script operating on /proc/?
Is it possible to configure the application and/or the operating system to free up the memory as soon as possible, not waiting for a low memory situation?
I can’t tell you how to change the memory usage, but I want to make a suggestion to install and examine the GUI tool xosview (“sudo apt-get install xosview”). The reason why is that it shows cache memory and buffer memory. There are plenty of times when RAM can be used for cache or buffer to improve performance for parts of the o/s. That use though does not bind the RAM; if more memory is required, then that category of RAM is released to be used elsewhere. xosview can have its GUI enlarged (just drag the edge or corner) and you will more clearly see buffer and cache graphically. Watch to see if the buffer and cache is what really changes over time. If it is, then there is nothing you need to do since cache and buffer will typically self-manage.
Hej @linuxdev thanks for your input, unfortunately we are running the code on a headless system. I guess xosview takes its information from /proc/meminfo and vmstat or do you have more insights on the way xosview does collect it information?
xosview uses a lot of information from “/proc”, and probably also “/sys”. Does your Jetson have ssh access available? If so, then you could still use xosview by remote display onto another Linux system that is running a GUI. For example, if you log in from the local host PC GUI, and from there do this to connect to the Jetson (wired gigabit networking is best, this is just using the example USB networking address…please choose the IP address of your best networking connection): ssh -Y 192.168.55.1
Then, upon login to the Jetson, if you run the command “xosview” it should appear on the the host PC. The display would be to the PC, but the program is running on the Jetson.
I couldn’t tell you the exact method that xosview uses to provide the cache and buffer memory listing.