[Gllug] My and my malloc() problems....

Alex Hudson home at alexhudson.com
Wed Dec 26 20:08:55 UTC 2001


On Wed, 2001-12-26 at 00:39, Darran D. Rimron-Molloy wrote:
> First of all, the machine IS NOT running out of ram, and the malloc itself
> isn't failing.

You seem awful sure the machine isn't running out of memory (ram !=
memory) - how do you know? Linux overcommits, so if malloc were failing
you would be _seriously_ worried.

> fails when I remove a sleep(1) statement from elsewhere in my code,

The only way I can think that this might make a difference is if you're
running threaded/event-driven code - the sleeps could be preventing some
memoery error.

However, you're not providing any base case which fails (always debug an
error to the smallest area of code possible), nor even saying how it
fails. Compiling -g and running in gdb ought to give you a good idea of
why the code is failing if you exhaust every other possibility.

Cheers,

Alex.

BTW, Happy Boxing Day everyone :o)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20011226/e4807698/attachment.pgp>


More information about the GLLUG mailing list