This is JNI\'s C++ code:
extern \"C\" JNIEXPORT jbyteArray JNICALL Java_cn_rilled_encoder_JNIEncoder_encodeEncryptBuff( JNIEnv* env, jobject obj,
I solved the problem with delete encryptBuff.
delete encryptBuff
... unsigned char* chars = (unsigned char *) malloc(chars_len); ... free(chars); delete encryptBuff; return bArray;
New memory usage: