java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space

Hi guys,

I experience "java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space" exception while my Java code is executed under my JNI code.

I'm stuck on the problem, what I have found - "Tenured Gen" reises all the time and that's why I have OOME. However within native java runner same memory pool is about 2Mbytes.

I' use JRE1.5.0_08.

Any memory leaks are fixed in C++ code. What could be the problem here? please point me?

Thanks,

Alex.

[501 byte] By [Alex_55_1a] at [2007-11-26 16:41:04]
# 1
Forgot to say: I works with array of String Objects though JNI.I'm not convenienced about : jboolean isCopy = JNI_TRUE;Can you help me ?Thanks,Alex.
Schutzengela at 2007-7-8 23:08:01 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Finally, the problem was :

jstring str;

for(int i = 0; i < xxx.GetSize(); i++){

CString cstr = xxx.GetAt(i);

str = env->NewStringUTF(cstr.GetBuffer(0));

env->SetObjectArrayElement(secondParam, i, str);

/* release memory */

env->DeleteLocalRef(counterUIName);

}

The "DeleteLocalRef(counterUIName);" should be made for each iteration.

Thanks,

Alex..

Schutzengela at 2007-7-8 23:08:01 > top of Java-index,Java HotSpot Virtual Machine,Specifications...