osefy.blogg.se

Shell script to monitor memory usage of a process
Shell script to monitor memory usage of a process











Relatively temporary storage for raw disk blocks that So, what are they actually? According to the manual of /proc/meminfo, which is a pseudo file and the data source of free, top and friends: Buffers %lu Most of buffers and cached Mem are given up when application processes claim more memory.Īctually free -m command provides a row for used and free taking buffers and cached into consideration. The only difference was that buffers and cached Mem were high on the long-running one.Īfter some research, or googling, I concluded that it was not a problem. I used top command with Shift+m (sort by memory usage) and compared processes on a long-running server and ones on a newly deployed server. Then why is the OS memory usage increasing? Buffers and cached memory Luckily I also had memory usages of application processes recorded, but they were not increasing. So, they are basically from OS, which was Alpine Linux on Docker in this case. const os = require( "os") Ĭonst usage = ((free - total) / total) * 100

shell script to monitor memory usage of a process

The memory usage was measured in the following Node.js code.

shell script to monitor memory usage of a process

After a while, I found that its memory usage % was growing slowly, like 20% in 3 days. Recently I started monitoring a Node.js app that we have been developing at work.













Shell script to monitor memory usage of a process