Microsoft KB Archive/198959

{|
 * width="100%"|

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

 * }

Q198959

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), on platform(s):
 * the operating system: Microsoft Windows 95
 * the operating system: Microsoft Windows 98

-

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
 * 4 - 255.9 MB
 * 255.9 MB and up

Additional query words: kbDSupport

Keywords : kbKernBase kbMemory

Issue type : kbprb

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch