lkml.org 
[lkml]   [1999]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: Recursive malloc crashing Linux. (Well almost)
Date

> My program (killmem.c, attached) doesn't recurse.
>
> It allocates (in a loop) lots of memory in 4MB chunk mmaps. (1GB total)
> It then fills each chunk one at a time until it dies.
> This demonstrates the ability to allocate far more memory than is
> available, and subsequently die when accessing it. This is overcommit,
> even when overcommit is turned off.
>
> Allocating memory in a single 1GB chunk fails gracefully, but allocating
> in 4MB chunks works until you access it.

*Yawn* You've written a program that manages to kill itself by shooting
itself in the foot. I can to that too:

char *j=NULL;
*j++;

Yes, Linux will overcommit even when overcommitting is turned off. There
really is no good way to solve this problem.

DS


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.086 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site