bug-glibc
[Top][All Lists]
Advanced

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

Re: Problem with malloc on very large blocks of memory


From: Petr Vandrovec
Subject: Re: Problem with malloc on very large blocks of memory
Date: Fri, 21 Mar 2003 23:02:35 +0100

On 21 Mar 03 at 16:47, Dan Klebanov wrote:
> I've found a problem with malloc on systems with swap disabled. In 
> particular, when attempting to allocate very large blocks of memory, 
> malloc will often return a legitimate pointer to a chunk of memory which 
> is corrupted at the end of the block.

I doubt that it is corrupted...
 
> I wrote a small program which demonstrates this bug on my system. It 
> attempts to find the largest possible allocatable block, and then it 
> writes to that block. Towards the end of the write (usually >98% close 
> to the end of the block), it gets a SIGKILL from the system.

What else do you expect? You also have error message in the kernel
log saying that system run out of memory and killed biggest memory
hog to stay alive. Just do not do that - disable memory overcommit
if your working set may be larger than available memory and you cannot
accept killing process.
                                                Petr Vandrovec
                                                address@hidden
                                                





reply via email to

[Prev in Thread] Current Thread [Next in Thread]