lkml.org 
[lkml]   [2000]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Overcomittable memory
Den 16-Mar-00 19:11:24 skrev Andreas Bombe følgende om "Re: Overcomittable memory":
> On Wed, Mar 15, 2000 at 04:00:42PM +0100, Rask Ingemann Lambertsen wrote:
>>
>> Well, guess what, then you won't get any error message, unless you were
>> clever enough to have allocated a string buffer previously.

> Allocated and touched.

No, allocated. I was assuming a system without overcommitment of memory.

> int i;
> char *ptr = malloc(1024);

> if (!ptr) thats_tough();

> for (i = 0; i < 1024; i++) ptr[i] = 0;

> Only then you can be sure that this memory is there, because malloc
> gave you a pointer and the for loop didn't get you killed.

Too bad the OOM killer may kill your program anyway in an OOM situation
to free up memory. So touching every page still doesn't get you anything.
You did manage to kill performance, though. The system will run slower when
touching each and every page becomes a standard measure in glibc, etc.

Regards,

/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯T¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\
| Rask Ingemann Lambertsen | E-mail: mailto:rask@kampsax.dtu.dk |
| Please do NOT Cc: to me or the | WWW: http://www.gbar.dtu.dk/~c948374/ |
| mailing list. I am on the list.| "ThrustMe" on XPilot, ARCnet and IRC |
| The impossible is only something that hasn't happened to you yet. |


-
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:57    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site