Is there any ready-to-use solution to log the memory consumption from the start of the system? I'd like to log the data to simple text file or some database so I can analyze it later.
I'm working on Linux 2.4-based embedded system. I need to debug the problem related to memory consumption. My application automatically start on every system start. I need the way to get the data with timestamps from regular intervals (as often as possible), so I can track down problem.
The symptoms of my problem: when system starts it launched my main application and GUI to visualize the main parameters of the system. GUI based on GTK+ (X server). If I disable GUI and X server then my application works OK. If I enable GUI and X server it does not work when I have 256 MiB or 512 MiB of physical memory installed on the motherboard. If I have 1 GiB of memory installed then everything is OK.
Check Detailed Memory Usage with Performance MonitorTo open up Performance Monitor type: perfmon into the Run window (Windows Key + R). In the window that comes up, click the Performance Monitor under Monitoring Tools in the left pane. The right pane turns into a live graph/chart that looks like the screenshot below.
The following script prints time stamps and a header.
#!/bin/bash -e echo " date time $(free -m | grep total | sed -E 's/^ (.*)/\1/g')" while true; do echo "$(date '+%Y-%m-%d %H:%M:%S') $(free -m | grep Mem: | sed 's/Mem://g')" sleep 1 done
The output looks like this (tested on Ubuntu 15.04, 64-bit).
date time total used free shared buffers cached 2015-08-01 13:57:27 24002 13283 10718 522 693 2308 2015-08-01 13:57:28 24002 13321 10680 522 693 2308 2015-08-01 13:57:29 24002 13355 10646 522 693 2308 2015-08-01 13:57:30 24002 13353 10648 522 693 2308
A small script like
rm memory.log while true; do free >> memory.log; sleep 1; done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With