How would I increase the memory used by the JNI?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, October 31, 2001 12:38 AM

The Java program uses JNI to call C++ code which uses vendor's dll. This is a mathematical model allocating huge multidimensional array. When the array size gets bigger, the JNI exits unable to allocate the multidimensional array. If I run some test with smaller dimensional array it works fine. I tried starting the java with -X option. It helps only initially. For example, starting with 128m heap memory helped to run test of 100 by 100 multidimensional array tests. But if I try to increase the heap size to 256m, it does not seem to help. Even double [100][100] is not that much memory. There are no memory leaks. I have confirmed running profile. The multidimentional array are declared deep in the C++ code. It is not in the the JNI wrappe   More>>


The Java program uses JNI to call C++ code which uses vendor's dll. This is a mathematical model allocating huge multidimensional array. When the array size gets bigger, the JNI exits unable to allocate the multidimensional array. If I run some test with smaller dimensional array it works fine. I tried starting the java with -X option. It helps only initially. For example, starting with 128m heap memory helped to run test of 100 by 100 multidimensional array tests. But if I try to increase the heap size to 256m, it does not seem to help. Even double [100][100] is not that much memory. There are no memory leaks. I have confirmed running profile.


The multidimentional array are declared deep in the C++ code. It is not in the the JNI wrapper. Also, the reason, I feel strongly that this is failing in array declaration is that if I comment the multidimentional array declaration. It works fine and also smaller size array works fine.


Seems like even though the JVM heap size is increased, the JVM in turn is not increasing the size for the JNI.


According to my understanding, the thread specific memory consists primarily of Java stacks, JNI local reference frames for each stack, and internal structures storing thread specific data like stack information, JNI virtual table and exception status.


How would I increase the memory used by the JNI? Or am I doing something wrong?
Any help greatly appreciated. Thanks in advance.

   <<Less
About | Sitemap | Contact