看这个日志了:# Path/hs_err_pid12073.log

解决方案 »

  1.   

    new、FindClass的对象,需要DeleteLocalRef,jni里面本地变量个数是有限制的。
      

  2.   

    JNIEXPORT void JNICALL Java_com_xxx_yyy_newObjects (JNIEnv *env, jobject)
    {
        int len = 100;
        for (int i = 0; i < len; i++)
        {
            jobject output = env->NewObject(g_OutIds.jCls, g_OutIds.mid_construct, "");
            if (NULL == output)
            {
                std::cout << i << "\tNewObject(g_OutIds) failed" << std::endl;
            }
            else
            {
                std::cout << i << "\tNewObject(g_OutIds) succeeded" << std::endl;
           //自己在这里调用DeleteLocalRef      进行output 的释放  }
        }
    }