Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Destroy JVM hangs the program

SasDuttaJun 16 2011 — edited Jun 17 2011
Hi

My program hangs when i try to destroy jvm by following statement.

(*jvm)->DestroyJavaVM(jvm);

I have created JVM by following code
int createJVMEnv(void)
{

    JavaVMInitArgs vm_args;
    JavaVMOption options[15];

    int res;
    if (env != NULL)
        return SUCCESS;

    const char * aim_class_path =getenv("AIM_CLASS_PATH");

    if( aim_class_path == NULL )
    {
    WriteLog(FATAL, "CLASSPATH variable is not set in the environment\n");
    }

    if(aim_class_path!=NULL)
    {
        char buf[5000];
        sprintf(buf,"-Djava.class.path=%s",aim_class_path);
        options[0].optionString=strdup(buf);
    }


    options[1].optionString="-DSystemMode=EJB";
    options[2].optionString="-Xms512m";
    options[3].optionString="-Xmx8192m";

    options[4].optionString="-Dfltsked.contextFactory=weblogic.jndi.WLInitialContextFactory";
    options[5].optionString="-Dfltsked.remoteObjectLocatorProviderURL=t3://aopcpscm.opc.ual.com:10001";
    /*options[5].optionString="-Dfltsked.remoteObjectLocatorProviderURL=t3://aopcqscmapp01.opc.ual.com:7001";*/

    options[6].optionString="-Dfltsked.user.loginID=u298724";

    options[7].optionString="-Dlog4j.rootLogger=OFF";
    options[8].optionString="-Dbatchmode.process=true";
    options[9].optionString="-Dweblogic.MaxMessageSize=1000000000";
    options[10].optionString="-Dweblogic.StuckThreadMaxTime=600";
    options[11].optionString="-Dweblogic.CompleteMessageTimeout=480";

    options[12].optionString="-Xcheck:jni";
    options[13].optionString="-Xnoclassgc";
    options[14].optionString="-Djava.compiler=NONE";
   vm_args.version = JNI_VERSION_1_6;
    vm_args.options = options;
    vm_args.nOptions = 15;
    vm_args.ignoreUnrecognized = JNI_TRUE;

    res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);

    if (res < 0) {
        WriteLog(FATAL, "Can't create Java VM\n");
        return FAILURE;
    }
    if ((*env)->ExceptionOccurred(env))
    {
        (*env)->ExceptionDescribe(env);
        return NULL;
    }


    return SUCCESS;
}
Can anyone help how can i destroy the jvm? jvm and env are global variable.

Thanks
Sas

Edited by: SasDutta on Jun 16, 2011 10:11 AM

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 15 2011
Added on Jun 16 2011
2 comments
1,426 views