src/share/vm/runtime/arguments.cpp

Print this page




2734           return JNI_ERR;
2735         }
2736 #endif // !INCLUDE_JVMTI
2737         add_init_agent(name, options, is_absolute_path);
2738       }
2739     // -javaagent
2740     } else if (match_option(option, "-javaagent:", &tail)) {
2741 #if !INCLUDE_JVMTI
2742       jio_fprintf(defaultStream::error_stream(),
2743         "Instrumentation agents are not supported in this VM\n");
2744       return JNI_ERR;
2745 #else
2746       if(tail != NULL) {
2747         char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail);
2748         add_init_agent("instrument", options, false);
2749       }
2750 #endif // !INCLUDE_JVMTI
2751     // -Xnoclassgc
2752     } else if (match_option(option, "-Xnoclassgc")) {
2753       FLAG_SET_CMDLINE(bool, ClassUnloading, false);

2754     // -Xconcgc
2755     } else if (match_option(option, "-Xconcgc")) {
2756       FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2757     // -Xnoconcgc
2758     } else if (match_option(option, "-Xnoconcgc")) {
2759       FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2760     // -Xbatch
2761     } else if (match_option(option, "-Xbatch")) {
2762       FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
2763     // -Xmn for compatibility with other JVM vendors
2764     } else if (match_option(option, "-Xmn", &tail)) {
2765       julong long_initial_young_size = 0;
2766       ArgsRange errcode = parse_memory_size(tail, &long_initial_young_size, 1);
2767       if (errcode != arg_in_range) {
2768         jio_fprintf(defaultStream::error_stream(),
2769                     "Invalid initial young generation size: %s\n", option->optionString);
2770         describe_range_error(errcode);
2771         return JNI_EINVAL;
2772       }
2773       FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size);




2734           return JNI_ERR;
2735         }
2736 #endif // !INCLUDE_JVMTI
2737         add_init_agent(name, options, is_absolute_path);
2738       }
2739     // -javaagent
2740     } else if (match_option(option, "-javaagent:", &tail)) {
2741 #if !INCLUDE_JVMTI
2742       jio_fprintf(defaultStream::error_stream(),
2743         "Instrumentation agents are not supported in this VM\n");
2744       return JNI_ERR;
2745 #else
2746       if(tail != NULL) {
2747         char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail);
2748         add_init_agent("instrument", options, false);
2749       }
2750 #endif // !INCLUDE_JVMTI
2751     // -Xnoclassgc
2752     } else if (match_option(option, "-Xnoclassgc")) {
2753       FLAG_SET_CMDLINE(bool, ClassUnloading, false);
2754       FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
2755     // -Xconcgc
2756     } else if (match_option(option, "-Xconcgc")) {
2757       FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true);
2758     // -Xnoconcgc
2759     } else if (match_option(option, "-Xnoconcgc")) {
2760       FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false);
2761     // -Xbatch
2762     } else if (match_option(option, "-Xbatch")) {
2763       FLAG_SET_CMDLINE(bool, BackgroundCompilation, false);
2764     // -Xmn for compatibility with other JVM vendors
2765     } else if (match_option(option, "-Xmn", &tail)) {
2766       julong long_initial_young_size = 0;
2767       ArgsRange errcode = parse_memory_size(tail, &long_initial_young_size, 1);
2768       if (errcode != arg_in_range) {
2769         jio_fprintf(defaultStream::error_stream(),
2770                     "Invalid initial young generation size: %s\n", option->optionString);
2771         describe_range_error(errcode);
2772         return JNI_EINVAL;
2773       }
2774       FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size);