1 Sep 2008 02:31
Re: Question on swapping behavior of new kernels
Peter Teoh <htmldeveloper <at> gmail.com>
2008-09-01 00:31:15 GMT
2008-09-01 00:31:15 GMT
sorry, just realize never complete my explanation....(Continue reading). the reason is because if there exists a max RSS, then there may already be swapout operation occuring in your process A running alone by itself, as it can never allocate more than the max rss. so multiple process can have max rss reached at the same time......hm.....sound quite reasonable in terms of resources allocation right? On Mon, Sep 1, 2008 at 8:27 AM, Peter Teoh <htmldeveloper <at> gmail.com> wrote: > Not sure if I am right or not, but the answer to your question is > something called "maximum RSS". U can learn this through several > experiments (my physical mem is 1G): > > a. write a C program to malloc 1MB. memset the space with > something. "ps aux" to see the total RSS for this process. RSS is > the physical pages memory that will be allocated for your C program. > After malloc() u can see that the RSS is a very small nos. But after > memset() it immediately become a large number. Alternatively, write > a loop to update byte by byte, and then u can see the growth of RSS > from small to large number,. > > b. Change 1MB to 10MB, and u can see that the RSS is increased. > > c. Change it to 90MB, and u can see that there is not much increased in RSS. > > "ps" give u the total RSS pages, but if u want to see the specific > breakdown of the physical pages per segment of memory, use > /proc/pid/smaps: >
.
the reason is because if there exists a max RSS, then there may
already be swapout operation occuring in your process A running alone
by itself, as it can never allocate more than the max rss. so
multiple process can have max rss reached at the same
time......hm.....sound quite reasonable in terms of resources
allocation right?
On Mon, Sep 1, 2008 at 8:27 AM, Peter Teoh <htmldeveloper <at> gmail.com> wrote:
> Not sure if I am right or not, but the answer to your question is
> something called "maximum RSS". U can learn this through several
> experiments (my physical mem is 1G):
>
> a. write a C program to malloc 1MB. memset the space with
> something. "ps aux" to see the total RSS for this process. RSS is
> the physical pages memory that will be allocated for your C program.
> After malloc() u can see that the RSS is a very small nos. But after
> memset() it immediately become a large number. Alternatively, write
> a loop to update byte by byte, and then u can see the growth of RSS
> from small to large number,.
>
> b. Change 1MB to 10MB, and u can see that the RSS is increased.
>
> c. Change it to 90MB, and u can see that there is not much increased in RSS.
>
> "ps" give u the total RSS pages, but if u want to see the specific
> breakdown of the physical pages per segment of memory, use
> /proc/pid/smaps:
>

RSS Feed