> memory area has to be accessed. In some memory management systems,
> the allocated area has to be actually written (demand zero paging).
> If you execute from a user account, not root, with ulimits enabled,
> you should be able to do:
> char *p;
> for(;;)
> {
> if((p = (char *) malloc(WHATEVER)) == NULL)
> {
> puts("Out of memory");
> exit(1);
> }
> *p = (char) 0x01; /* Write to memory */
> }
> ... without hanging the system.
Allow me to nitpick :o)
int loop;
for(loop=0;loop<WHATEVER; loop+=PAGESIZE)
p[loop] = 0x01;
Because: as far as I remember only the pages that are touched are
allocated, not the whole memory-block.
But, indead, that's nitpicking. Sorry for that :o)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/