site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com AgenM wrote: Linux (by default) employs the so-called Out-Of-Memory Killer (OOM Killer) which allows malloc to overcommit and effectively lie about how much memory is available for allocation. If the overcommitted pages are then written (as you do below) then a heuristic takes over in the kernel to kill (with SIGKILL) some program-- cross your fingers and hope it doesn't kill your database or long-running number- cruncher. I think FreeBSD kills the process that requests the memory, rather than one at random. Seems slightly more sane. I think it is a bug in the 32bit handling too, albeit less dramatic. The process b0rked with a bus error rather than an "Out Of Memory". for example ----------------------- cut here ----------------------- #!/bin/sh perl -le ' @foo=qw(hello) ; for (my $i ; $i<100 ; $i++) { push(@foo, @foo) || die "$i -- no more\n" ; print "$i" ; } ; print "size is $#foo" ; ' ----------------------- cut here ----------------------- which produces a result like 1 <-- snipped --> 24 perl(226) malloc: *** vm_allocate(size=8421376) failed (error code=3) perl(226) malloc: *** error: can't allocate region perl(226) malloc: *** set a breakpoint in szone_error to debug Out of memory! S a m _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Obviously, you revealed a bug in the Darwin kernel's 64-bit handling This email sent to site_archiver@lists.apple.com
participants (1)
-
Sam Hart