login
Header Space

 
 

Re: This program hangs Linux

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Wednesday, August 5, 1992 - 11:27 am

i have the same problem with the linux locking up when i run out of
memory. version .97 + 32mb patches applied by hand (a number of things
have changed), 386-40 with 20Meg ram, no swap.  is the mm returning
failure (or not in this case) when it runs out of memory, or just 
waiting for memory to free up, or just plain locking up somewhere?

it lockes up around 17 or 18(000,000).

#include <stdio.h>
extern void * calloc(size_t,size_t);

main()
{
        void * a, *b;
        unsigned long size = 0;
        while ( a = calloc ( (size_t) 1000000,1 ) ) {
                size += 1000000;
                printf("up to: %d\n",size); fflush(stdout);
                b = a;
        }
        free(b);
        printf("up to: %d\n",size); fflush(stdout);
        return 0;
}

croutons.
croutons@dartmouth.edu
croutons@crunchy.UUCP

ps: i found the problem with the /dev/tty thingy. it was a silly 
    precedence thing, i forgot a pair of ()'s. (grumble grumble).
    thanks for those who helped out.
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: This program hangs Linux, The Crouton Man, (Wed Aug 5, 11:27 am)
speck-geostationary