Re: R: Oom Killer - How to simulate an "out_of_memory"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2005-09-26 at 14:45 +0200, Perego Paolo Franco wrote:
> You can malloc() inside an infinite loop... IMHO is good to simulate a memory emergency situation.
>  

it's not enough. In addition to the malloc, you also want to memset()
that memory to some value. Otherwise the kernel will not actually
allocate ram for the memory in malloc...

(linux does that lazy.. eg not until you use it. memset() is using it...
just malloc() is not)


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux