[vox-tech] can YOU be certified?!?

Tim Riley vox-tech@lists.lugod.org
Sun, 21 Jul 2002 11:08:26 -0700


Peter Jay Salzman wrote:

> begin ME <dugan@passwall.com>
> > On Sun, 21 Jul 2002, Peter Jay Salzman wrote:
> <snip>
>
> besides /cat/swaps, i thought of one more good way to know if you need
> to add swap space:
>
> out of memory errors when you start new processes.

To confirm this I wrote the following program:

#include <stdio.h>
#include <stdlib.h>

#define BUFFER_INCREMENT        1024000

int main( int argc, char **argv )
{
        char *buffer = "";
        unsigned long i;

        for ( i = BUFFER_INCREMENT; buffer ; i += BUFFER_INCREMENT )
        {
                buffer = malloc( BUFFER_INCREMENT );
                printf( "Total allocation = %ld ", i );

                if ( buffer )
                {
                        strcpy( buffer, "Hello world!" );
                        printf( "Succeeded = %s\n", buffer );
                }
        }
        printf( "Failed\n" );
        sleep( 10 );
        exit( 0 );
}

Two weird things occurred when I ran this.

First, the "top" command never showed
any swap space usage. Moreover, the
memory available never made it to zero.
It went from 28M down
to 18M before the malloc failed.

Second and serendipitously, the bytes
allocated was 14 times more that the
total of memory and swap space.
(I have 64M memory and 72M
of swap (136M total), yet I was able to malloc
1987M of memory.)

Can anyone see why?

>
>
> disk churning == RAM starved
> out of memory errors == RAM and swap starved
>
> > This is a bad Question, but so far not as bad as Qs from the MS Cert
> > exams. I seem to recall one MS cert Q asking about solutions for mail
> > service  *requiring* the user to choose "the best soltution for this would
> > be installation of MS Exchange."
>
> tee hee.  kinda like how larry ellison is advocating national health and
> crime databases (and of course, he says oracle would be the best
> solution).
>
> biz types can be so tacky and gauche, i'm embarrased for them.
>
> pete
>
> --
> GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech