From: Qin Fang (fang@cs.unc.edu)
Date: 02/22/93


From: fang@cs.unc.edu (Qin Fang)
Subject: can't allocate 4M memory
Date: 22 Feb 1993 19:27:04


  When I compiled a program using g++, I got "Out of memory" message. So I
wrote the following simple program:

  #include <malloc.h>

  main()
  {
    int i, j;
    char *buf;

    i = 1024*1024; /* that is 1M */
    i *= 4; /* now it is 4 M */

    buf = malloc(i);

    for (j=0 ; j<i; j++) buf[j] = 0;
  }

  When I run the program, I get a message "Killed". If I allocate less than
4M, it works fine.
  My set ups is Linux 0.99pl5, gcc 2.3.3, lib 4.3.

  Hardware:
  486 50/Dx2, ISA bus, 8M memory, 16M swap partition.
  
  Any help? Thanks.