Re: 64-bit question
Re: 64-bit question
- Subject: Re: 64-bit question
- From: Sam Hart <email@hidden>
- Date: Tue, 8 Nov 2005 09:09:16 +0000
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.
Obviously, you revealed a bug in the Darwin kernel's 64-bit handling
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden