PRB: Windows 95/98 Heaps Have A 255.9 MB Allocation Ceiling

ID: Q198959


The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK)
    on the following platforms: Win95, Win98


SYMPTOMS

There is a hard-coded limit on Windows 95/98 for a single heap allocation. This limit is 104 bytes shy of 256 MB.

This limit will apply to HeapAlloc() and any function that internally calls HeapAlloc(); including LocalAlloc(), GlobalAlloc(), and many implementations of the C-runtime library's malloc() function.


STATUS

This behavior is by design.


MORE INFORMATION

If you expect your memory blocks to be larger than one or two megabytes, you can avoid significant performance degradation by using the VirtualAlloc() or VirtualAllocEx() functions instead. When working with the heap functions, memory allocations are classified into the following three block size ranges:

  • 0 - 4 MB


  • The heap functions work well for allocations in this range.

  • 4 - 255.9 MB


  • The heap functions work for allocations in this range, but they are not recommended due to poor performance.

  • 255.9 MB and up


  • The heap functions do not support allocations above 255.9 MB.

Additional query words: kbDSupport

Keywords : kbKernBase kbMemory
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: April 15, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.