Re: Maximum size for allocating memory
From: Tim Robinson (tim.gaat.freeserve.co.uk_at_nowhere.com)
Date: 02/04/05
- Next message: Tim Robinson: "Re: How to I get if I have a connection to the internet?"
- Previous message: Larry Brasfield: "Re: Wrong optimisation in Visual C++.net Release Build"
- In reply to: Drew Myers: "Maximum size for allocating memory"
- Next in thread: Drew Myers: "Re: Maximum size for allocating memory"
- Reply: Drew Myers: "Re: Maximum size for allocating memory"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 04 Feb 2005 22:20:22 +0000
Drew Myers wrote:
> Is there a maximum size that can be passed to malloc?
>
> Large allocations are giving this message in the output window:
>
> HEAP[MyApp.exe]: Invalid allocation size - B1DA4F78 (exceeded 7ffdefff)
>
> Is this an error message? Should I care about this?
This is Windows' way of telling you: You've attempted to allocate more
than the 32-bit Windows architecture can ever handle (which is a touch
under 2GB, hence the number 0x7ffdefff). You're trying to allocate
almost 2.78GB in a single request. If this is what you really want, then
you should either take a serious look at your design, or move to 64-bit
Windows. If this isn't what you want, then you've likely got a bug in
your program.
-- Tim Robinson (MVP, Windows SDK) http://mobius.sourceforge.net/
- Next message: Tim Robinson: "Re: How to I get if I have a connection to the internet?"
- Previous message: Larry Brasfield: "Re: Wrong optimisation in Visual C++.net Release Build"
- In reply to: Drew Myers: "Maximum size for allocating memory"
- Next in thread: Drew Myers: "Re: Maximum size for allocating memory"
- Reply: Drew Myers: "Re: Maximum size for allocating memory"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|