tmpfs in Linux

tmpfs

1.0 tmpfs

tmpfs is a filesystem that resides in the main memory of a Linux system. In the case of disk files, a file is first fetched into the kernel pagecache and the delivered to the requesting process. The fetch part is not there in the case of tmpfs as the files are created and updated directly in kernel caches.… Read more

htop command in Linux

htop

1.0 INTRODUCTION

htop is a ncurses based program for viewing processes in a system running Linux. htop is quite similar to the top command. However, since htop is a newer program compared to top, it offers many improvements. htop supports mouse operation, uses color in its output and gives visual indications about processor, memory and swap usage.… Read more

sar in Linux

Penguin

The sar command under Linux and Unix systems gives the system activity reports. As the system works, a record of activities is kept in certain counters in the kernel. The sar command gives statistics regarding the CPU, I/O, paging, devices, memory, swap space, network, run queue length and load average, interrupts and power management.… Read more

pidstat

The best way to use pidstat is to pass a list of process ids with the -p parameter. The -u option reports CPU utilization. The -l parameter displays the process command name and its arguments. And we can optionally put time interval in seconds for the interval between reports and again, optionally, a count for number of reports.… Read more

vmstat

The vmstat command prints the system virtual memory statistics for Linux and Unix systems. vmstat prints information about system processes, memory, swap, I/O blocks, interrupts and context switches and the CPU activity. The most common command format is,

vmstat [delay [count]]

The optional delay parameter tells the time interval between periodic vmstat outputs.… Read more

Finding the free and used memory with the free command

Using the free command, the free and used memory in a Linux or Unix system can be found. The free command can be given from the command line as,

free

And the system responds with an output like,

             total    used     free  shared  buffers  cached
Mem:        960268  873136    87132       0    14652  168884
-/+ buffers/cache:  689600   270668
Swap:      2996116   95332  2900784

In the above output, the system has 960,268 kilobytes of total memory, which is less than the actual physical memory because the memory occupied by the kernel is not reported here.… Read more