Subject: Re: Why would malloc return NULL?
From: [email-masked] (Pierre A. Humblet)

14 Nov 1998 04:50:54 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
To: [email-masked]

I have got exactly the same problem when porting gnu spell-1.0 to b19, see
ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin32/porters/Humblet_Pie
rre_A/B19/ispell.readme

The problem persists in b20. It seems to be related to the number of
outstanding malloc calls and not to the total memory allocated. In my case
it was easier to modify the source to free blocks ASAP rather than trying
to understand and fix b19...

Pierre

At 04:18 PM 11/12/98 -0500, [email-masked] wrote:
>
>We have ported a large Unix application to NT using Cygwin (b19) and
>seem to have a problem with malloc returning NULL when there is still
>plenty of unused memory.  The machine has 256M of RAM, and 512M of
>swap.  We attempted to allocate 16 bytes when malloc returned NULL,
>and according to the task manager, we have over 130M of unused
>physical RAM.  I tried linking in the mmalloc library to track down
>what was causing this, but that just seemed to delay the problem.  To
>make matters worse, everything ran just fine when in the debugger (and
>mmalloc was linked in).  Also, the problem goes away when you compile
>with debug information.
>
>In Unix, the only reasons I would expect for malloc to return NULL is
>if the system ran out of memory or someone trashed the memory
>allocation tables.  I think I can rule out running out of memory
>(unless someone can suggest why this could happen with that much space
>left), so are there any other reasons why this could happen in Cygwin?
>
>Thanks,
>-Derrick
>
>-- 
>Derrick Franceschini                    SAIC -- ADST II -- ModSAF
>[email-masked]                        Phone (407)-306-4113
>                                           Fax   (407)-306-4075

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".