Knowledge Base

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

PSS ID Number: 198959

Article Last Modified on 5/12/2003


The information in this article applies to:


This article was previously published under Q198959

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 kbprb KB198959
Technology: kbAudDeveloper kbOSWin95 kbOSWin98 kbOSWinSearch kbSDKSearch kbWin32SDKSearch kbWin32sSearch