Large heap sizes cause JVM crash when calling glTexImage3D

I’m having a problem where my application is crashing on a glTexImage3D call, but only when the heap size is very large, say 1200MB. I’m trying to allocate a 3D texture that is 512x512x287 using short data. I’ve got a Quadro 4400 so the memory on the card isn’t an issue. I also have 2GB of memory in my machine, so that shouldn’t be the problem either. Furthermore, this call will succeed for lower heap sizes, such as 800MB.

It seems like there’s only so much memory that can be shared between the java heap and what can be allocated for OpenGL, but I don’t know what that limit is and how to determine if I’ve reached it. If anyone has any information about why this might be happening and how I could prevent it, that would be greatly appreciated. Thanks for your time.

The top portion of the dump that happens from the crash follows:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x69714D88
Function=DrvCopyContext+0x1C7C8
Library=C:\WINDOWS\system32\nvoglnt.dll

Current Java thread:
at net.java.games.jogl.impl.windows.WindowsGLImpl.dispatch_glTexImage3D(Native Method)
at net.java.games.jogl.impl.windows.WindowsGLImpl.glTexImage3D(WindowsGLImpl.java:25585)

It’s possible you’re running out of address space. By default Windows processes have access to about 1.8 GB of address space although this limit can be raised by limiting the amount of space the kernel consumes. I think this can be tuned in boot.ini but you’ll have to search the web for more information about it.