From: Yohanes Santoso Date: 2004-08-27T02:28:10+09:00 Subject: Re: Ruby interpreter as client-server MiG writes: > Have you any idea how to get the real memory usage of each process? There is no easy way to get accurate real memory usage of each process, especially those that are just freshly forked. BTW, the 'real' memory usage is the RSS column, not VSZ. VSZ is the size in virtual memory. VSZ-RSS is the size on swap or will be swapped without further examination. Take for example: dede:~$ ps -ao pid,vsz,rss,command|grep ruby 3086 3012 1364 ruby1.8 -e fork { sleep(9999) }; Process.wait 3087 3016 1376 ruby1.8 -e fork { sleep(9999) }; Process.wait The above does not necessarily mean that these two processes combined use 1364+1376=2740 KB. Most UNIX-like OSes perform copy-on-write (CoW). Meaning, if you fork but do not modify anything, then you will only incur the cost to track another process in the kernel (around 12KB or so in Linux). YS.