This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Why would malloc return NULL?


On Thu, 12 Nov 1998, Derrick Franceschini 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.

Anytime this happens, I first suspect bugs in the code instead of the
runtime. 

I have code using 400M of RAM, in small and big chunks on Cygwin, and it
works as advertised. That of course doesn't preclude bugs in Cygwin, but
at least it shows it's not completely broken ;-)

Have you run your code through some malloc debugger (such as the excellent
Purify package or even something as simple as ElectricFence or dmalloc)?
  
Regards,
Mumit 

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]