Re: Overcomittable memory

From: Rask Ingemann Lambertsen (rask-linux@kampsax.k-net.dk)
Date: Mon Mar 20 2000 - 09:33:53 EST


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/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:29 EST