jni memory allocation problems

i have serious memory allocation problems via JNI i communicate with a dll, that consumes over 1 GB of system memory( it’s just the way how the dll works). This dll does various calculation on the data, which further increases the memory allocation( in the order of 1.2 gb) but i get a java out of memory error( native ).
Is there a way i can give JNI more memory?

tia

Paul

You’re probably running out of address space on a 32-bit machine. The only workarounds for this are either to decrease the Java heap size to give the C heap more room to grow or to use a 64-bit JVM on a 64-bit CPU and OS.

You can also set the address space for java.exe to be 3G instead of 2G.

I wrote about this in my blog at http://jroller.com/page/rreyelts/20040914

Basically, you won’t be able to grow your Java heap over 1.3G or so, because it needs to allocate its heap contiguously, but you can use the extra 1G of address space for your native code - which is exactly the problem you’re trying to solve here.