JNI Newbyte array is taking a lot of time to execute

180 Views Asked by At

I have a simple JNI call in which new bytes are allocated. I made a call to NewByteArray() function. But that function is taking around 30 seconds to allocate memory. How to make it fast or is I am missing something. sdk used is Android API level 21 (Android L)

    static jobject getImageRGBABuffer(JNIEnv *env,ASUns8 *buffer, int width, int height)
    {

        /*some code*/
        //size os around 300000
        jbyteArray rgbByteArray = env->NewByteArray(size);
        //The above statement is taking around 30 seconds. 
        //How to make it fast or is I am missing something
        return byteBuffer;
    }
0

There are 0 best solutions below