Windows memory limitation

I am using OpenGL to display large 2D-images in windows with W2K / W XP. When using OpenGL the amount of main memory which may be allocated by the program seems to be limited to 1 GB, although much more memory is installed in the PC. If OpenGL is not used by the same program, memory can be allocated as expected (up to 2 GB).

Can anyone help me ? Does an absolute limit or address limit of usable memory exist ? Can it be changed ? How ? Depends it on the video hardware / driver ?

The opengl driver uses some memory to store texture data, so this is probably your problem.

>>Does an absolute limit or address limit of usable memory exist ?<<

Yes, on 32-bits OSes the virtual address space is 4GB. Under Windows 32-bit systems that is normally divided to 2GB for user and 2GB for kernel space. Addresses with the highest bit set are kernel addresses then. Note, this is virtual address space per process.

>>Can it be changed ?<<

Not the limit, but the user address space size.

>> How ? <<

Under Windows 32-bit systems there is a /3GB switch to be added in the boot.ini and your program needs to be compiled as /LARGEADDRESSAWARE.
The 32-bit address space is then divided to 3GB user and 1GB kernel addresses.

Read the links on the bottom of this site:
http://www.opengl.org/pipeline/article/vol003_7/
Works the same way under WinXP

The true solution is to switch to a 64-bit OS version and compile your app 64-bit natively.

I think 32-bit apps under a 64-bits OS can address 4GB user space. (Not tried.)

It is possible to work around the virtual address space limitation and manipulate all physical memory supported by OS (some 32bit Windows editions supports more than 4GB of physical memory) however the program code must be modified to access this additional memory in special way using the Address Windowing Extensions . It will allow you to have more application data in memory (e.g. as cache) however it will not work around address space consumed by driver so ammount of memory you can have simulatenously uploaded to it will be limited.

Problem with this approach is that it requires user rights which even the administrator does not have by default and that it does not work well in highly multitasking environment because it is meant for use with applications that have entire computer available (e.g. database serves, huge data processing applications).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.