[haiku-development] Re: Weird memory behaviour.

Bruno Albuquerque wrote:

#include <unistd.h>

int main(void) {
  char* test - new char[1024 * 1024 * 500]
  sleep(5); // Give some time so AM can pick the change.

  // Intentionally leak allocated memory.
}

On a related note, if I change the above program to allocate 850 Mb (I am running VMWare with 1 Gb of available memory for Haiku) it will crash with a segmentation fault in add_fdes() (inside libroot, it seems) instead of simply bailing out with an out of memory error.

-Bruno


Other related posts: