Graphics Program Cannot Create Large Bitmap

Article translations Article translations
Article ID: 227617 - View products that this article applies to.
This article was previously published under Q227617
This article has been archived. It is offered "as is" and will no longer be updated.
If this article does not describe the error message that you are receiving, view the following Microsoft Knowledge Base article to view more articles that describe error messages:
315854 Windows 98 and Windows Me Error Message Resource Center
Expand all | Collapse all

Symptoms

Some graphics programs may encounter problems when attempting to create large bitmaps.

Cause

The CreateDIBSection API function may return a null value (indicating that the request did not succeed) when requested to create a large bitmap. Although there is no exact size that results in this condition, requests needing dozens of megabytes (MB) of addressable memory space fall into the potential problem category.

For example, you can expect repeated calls to the CreateDIBSection function against a 5,000 X 5,000 X 24 bitmap to eventually not succeed on a 16-MB computer (with a potential not to succeed the first time). After the function does not succeed, the requested-size bitmap cannot be allocated without first rebooting the computer.

The number of bitmaps that you can create and delete before this behavior occurs may appear to be inversely proportional to the size of the requested bitmap. Specifically, the smaller the bitmap, the greater the number of times you can create and destroy a bitmap of that size before the issue occurs. Note that a call to the CreateDIBSection function does not immediately attempt to commit physical memory to the bitmap.

The core bitmap manipulation routines in the Graphic Device Interface (GDI) are 16-bit. This requires Windows to "tile" a contiguous array of selectors across the bitmap memory allocation to facilitate 16-bit segmented addressing.

The necessary array of selectors is taken from the kernel local descriptor table, which tends to become fragmented over time as a consequence of the generally disorderly nature of memory allocations and deallocation. This results in an eventual inability to satisfy successive requests for large bitmap allocations.

Note that the value of the fifth parameter to the CreateDIBSection function (HANDLE hSection) is immaterial, because an array of selectors is needed for the 16-bit GDI core to address file mapping objects.

Status

Microsoft has confirmed this to be a design limitation in the Microsoft products listed at the beginning of this article.

An update to the system kernel to enhance local descriptor table management was incorporated into Windows Millennium Edition, which reduces the possibility of CreateDIBSection failure.

More information

This problem is known to affect the operation of some versions of the LView Pro image processing program. You can obtain additional information about this product at the LView Pro Web page:
http://www.lview.com
Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Properties

Article ID: 227617 - Last Review: October 26, 2013 - Revision: 2.0
Applies to
  • Microsoft Windows 95
Keywords: 
kbnosurvey kbarchive kb3rdparty kbenv kbkern32dll kbprb kbprogramming KB227617

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com