lkml.org 
[lkml]   [1998]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectSmall problem with malloc() tested on 2.1.117/115 (and maybe affecting others)
I have found that when I malloc() memory and do not access it/clear it,
I can malloc() a very large amount (around 2 gigabytes). I only have
around 170 MB in swap and ram. If I immediately memset() after each
malloc(), I have found that malloc will properly return NULL when it
cannot allocate more. Now the problem comes when I allocate all 2
gigabytes, then after all that I loop again to memset() them. When it
reaches beyond the bound of available ram, I find that my computer slows
to a near halt (even running as normal user). I cannot do
anything (except switch VC) until CTRL-C or Alt-SYSRQ-K (and even after
that it takes about 2 - 3 minutes to close out the program and restore
all). Somebody else who tested this on their machine (I tested it on my
two..same for both) says the program segfaults.

I'm not sure how much of a bug this could really be considered, but
usually when I malloc() I expect that I will have that memory there
(assuming it did not return NULL) to use and will not have to worry
about writing out into oblivion. While this bug is present, I could see
this causing programs to act weird or otherwise cause problems when
memory is low.

Regards,
David


-
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.altern.org/andrebalsa/doc/lkml-faq.html

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