The following tests have been executed on the ARM based TISDP2420 reference board. The Y-axis on the graphs shows the memory consumption measured in 4-kilobytes pages. The measurement is done with the [kernel patch implementing /dev/kp0 device](http://mail-index.netbsd.org/tech-kern/2008/08/14/msg002431.html) (the same results can be obtained by [sysctl -n machdep.kmpages](http://mail-index.netbsd.org/tech-kern/2008/08/14/msg002439.html)). **Contents** [[!toc levels=3]] # Fork, kill and fork again [![Image:Fork.png][12]][13] [12]: /images/Fork.png [13]: /images/Fork.png (Image:Fork.png) Start up to 40 new processes (all the children are doing nothing, just sleeping and waiting for the KILL signal), after that reduce the children amount to zero, and grow it again repeating the same measurement a few times. The x-axis represents the process counter **i** (see the following pseudo code). ## The blue curve marked 'fork' for i in (0,1,2,...,39,40,39,...,2,1,0,1,2,...,40,...,0,...,40,...,1,0) { if i > previous value of i: start a new child by calling fork() [the child process does infinite sleep()] ; else: /* i less than previous value of i */ kill the last started child and rip it ; Remember page counter value ; } for i in (1,2,3,4,5) { allocate all the memory in the system (see below); Remember page counter value and mark the first and the last with "!" ; } The "allocate all the memory" step above is performed as follows. A new child consuming memory in a infinite loop is starting. After the system is running out of memoty, this child is killed by the kernel, thus all the memory allocated by it is freed. ## The red line marked 'fork-and-kill' for i in (the same list as above) { Kill and rip ALL the children (if any exist) ; Start i new children by calling fork() and sleep() ; Remember page counter value ; } Allocate all the memory five times (as above) # Writing files [![Image:Write.png][14]][15] [14]: /images/Write.png [15]: /images/Write.png (Image:Write.png) Open up to 40 files (the green curve represents temporary files on **tmpfs**, the red one is the same for **nfs**, the blue curve represents writing to **/dev/null**) and write some data to them: for i in (0..40..0..40..0..40..0) { if i > previous value of i: open a new file ; unlink the opened file unless writing media is NOT /dev/null ; else: /* i previous value of i: open a new connection ; else (i