slabinfo – kernel slab allocator statistics

WHAT IS SLAB ALLOCATION ? Slab allocation is a memory management mechanism intended for the efficient memory allocation of kernel objects. It eliminates fragmentation caused by allocations and deallocations. The technique is used to retain allocated memory that contains a data object of a certain type for reuse upon subsequent allocations of objects of the …

Detecting Memory Leaks (leak: + ive)

commandline session $gcc -g leak.c $valgrind –tool=memcheck –leak-check=full ./a.out ==4353== Memcheck, a memory error detector ==4353== Copyright (C) 2002-2012, and GNU GPL’d, by Julian Seward et al. ==4353== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==4353== Command: ./a.out ==4353== ==4353== ==4353== HEAP SUMMARY: ==4353== in use at exit: 100 bytes in 1 …

Detecting Memory Leaks II

commandline session $gcc -g -ansi -pedantic -W -Wall algorithm.c algorithm.c: In function ‘main’: algorithm.c:47:5: warning: unused variable ‘value’ [-Wunused-variable] algorithm.c:36:7: warning: unused variable ‘p’ [-Wunused-variable] algorithm.c:35:5: warning: unused variable ‘i’ [-Wunused-variable] algorithm.c:34:14: warning: unused parameter ‘argc’ [-Wunused-parameter] algorithm.c:34:26: warning: unused parameter ‘argv’ [-Wunused-parameter] $valgrind –tool=memcheck –leak-check=full ./a.out ==23555== Memcheck, a memory error detector ==23555== Copyright …

Detecting Memory leaks

commandline session $valgrind –tool=memcheck –leak-check=full ./a.out ==6002== Memcheck, a memory error detector ==6002== Copyright (C) 2002-2012, and GNU GPL’d, by Julian Seward et al. ==6002== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==6002== Command: ./a.out ==6002== -31 0 1 2 2 4 100 83 99 782 ==6002== ==6002== HEAP SUMMARY: ==6002== in …

free – Display amount of free and used memory in the system

commandline session $free -m -c 10 -s 10 total used free shared buffers cached Mem: 1948 1816 131 0 105 536 -/+ buffers/cache: 1175 773 Swap: 5706 19 5687 total used free shared buffers cached Mem: 1948 1816 131 0 105 536 -/+ buffers/cache: 1175 773 Swap: 5706 19 5687 total used free shared buffers …

What is an Unevictable LRU Infrastructure ?

RELATED TO Unevictable The Unevictable LRU infrastructure addresses the following classes of unevictable pages: + page owned by ram disks or ramfs + page mapped into SHM_LOCKed shared memory regions + page mapped into VM_LOCKED [mlock()ed] vmas Least Recently Used (LRU): discards the least recently used items first. This algorithm requires keeping track of what …

Unevictable: 4 kB 0.1

Unevictable: 4 kB The Unevictable LRU infrastructure addresses the following classes of unevictable pages: + page owned by ram disks or ramfs + page mapped into SHM_LOCKed shared memory regions + page mapped into VM_LOCKED [mlock()ed] vmas Least Recently Used (LRU): discards the least recently used items first. This algorithm requires keeping track of what …

tcp mem vector of 3 integers

$cat /proc/sys/net/ipv4/tcp_mem 40704 54272 81408 $ tcp_mem vector of 3 INTEGERs: min, pressure, max min: below this number of pages TCP is not bothered about its memory appetite. pressure: when amount of memory allocated by TCP exceeds this number of pages, TCP moderates its memory consumption and enters memory pressure mode, which is exited when …

free – Display amount of free and used memory in the system

A UNIX Command $free total used free shared buffers cached Mem: 507008 432908 74100 0 14700 186816 -/+ buffers/cache: 231392 275616 Swap: 1485972 0 1485972 $free -m total used free shared buffers cached Mem: 495 422 72 0 14 182 -/+ buffers/cache: 225 269 Swap: 1451 0 1451 $ UNIX Explanation Display amount of free …