JNI How to allocate memory for object array dynamically : I am working on JNI with C language. Here i have created a object array of size 4000. According to my requirements the array size has to grown dynamically. How can i allocate memory dynamically. I have tried using malloc. But i cant achieve this.

OriginalArray = (*env)->NewObjectArray(env, 4000, tradeObject, NULL);