On linux, there are commands for almost everything, because the gui might not be always available. When working on servers only shell access is available and everything has to be done from these commands. It is often important to check memory usage and memory used per process on servers so that resources do not fall short and users are able to access the server.
There isn’t just one way to get out of a crash on Ubuntu or any other Linux system. The circumstances around a crash are always different. Although Linux servers are known to be reliable, occasionally computers fail. While an occasional system crash might not seem like much, in an enterprise setting, accurately diagnosing the cause of system failures is a must because a system failure can be an indicator of significant underlying software or hardware problems. While troubleshooting can be a difficult task, by using the tools mentioned in this guide, you can ensure that you are able to tackle even the toughest challenges.
There are certain commands which lets you see into the memory bagging processes with ease. This may not be a permanent solution, but can get your site up and running during emergency.
- Free Command
Linux has the habit of caching lots of things for faster performance, so that memory can be freed and used if needed. As free displays the details of the memory related to your system , its syntax doesn’t need any arguments to be passed but only options which you can use according to your wish.
The /proc file system does not contain real files. They are rather virtual files that contain dynamic information about the kernel and the system. The ‘/proc/meminfo‘ is used by to report the amount of free and used memory (both physical and swap) on the system as well as the shared memory and buffers used by the kernel.
There are two type of statistics that are used i. VM statistics ii. Memory statistics.
vmstat reports information about processes, memory, paging, block IO, traps, disks and cpu activity. The first report produced gives averages since the last reboot.
- Top command
The top command is generally used to check memory and cpu usage per process. However it also reports total memory usage and can be used to monitor the total RAM usage. The top command is generally used to check memory and cpu usage per process. However it also reports total memory usage and can be used to monitor the total RAM usage.
At this point, you will no longer be bothered by those pesky crash reports on your system. Just remember, although those can be rather annoying, bug reports are a critical element in a developer’s process. If you’d like to keep apport running, you can always delete the crash report (from /var/crash), once you’ve submitted the report for that particular bug, and no longer be bothered with the report for that crash. And don’t forget, you can always disable/enable apport at your leisure.