src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hsx-gc-8025661 Sdiff src/share/vm/runtime

src/share/vm/runtime/arguments.cpp

Print this page




2667                     "Invalid initial heap size: %s\n", option->optionString);
2668         describe_range_error(errcode);
2669         return JNI_EINVAL;
2670       }
2671       FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
2672       // Currently the minimum size and the initial heap sizes are the same.
2673       set_min_heap_size(InitialHeapSize);
2674     // -Xmx
2675     } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
2676       julong long_max_heap_size = 0;
2677       ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1);
2678       if (errcode != arg_in_range) {
2679         jio_fprintf(defaultStream::error_stream(),
2680                     "Invalid maximum heap size: %s\n", option->optionString);
2681         describe_range_error(errcode);
2682         return JNI_EINVAL;
2683       }
2684       FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size);
2685     // Xmaxf
2686     } else if (match_option(option, "-Xmaxf", &tail)) {
2687       int maxf = (int)(atof(tail) * 100);
2688       if (maxf < 0 || maxf > 100) {

2689         jio_fprintf(defaultStream::error_stream(),
2690                     "Bad max heap free percentage size: %s\n",
2691                     option->optionString);
2692         return JNI_EINVAL;
2693       } else {
2694         FLAG_SET_CMDLINE(uintx, MaxHeapFreeRatio, maxf);
2695       }
2696     // Xminf
2697     } else if (match_option(option, "-Xminf", &tail)) {
2698       int minf = (int)(atof(tail) * 100);
2699       if (minf < 0 || minf > 100) {

2700         jio_fprintf(defaultStream::error_stream(),
2701                     "Bad min heap free percentage size: %s\n",
2702                     option->optionString);
2703         return JNI_EINVAL;
2704       } else {
2705         FLAG_SET_CMDLINE(uintx, MinHeapFreeRatio, minf);
2706       }
2707     // -Xss
2708     } else if (match_option(option, "-Xss", &tail)) {
2709       julong long_ThreadStackSize = 0;
2710       ArgsRange errcode = parse_memory_size(tail, &long_ThreadStackSize, 1000);
2711       if (errcode != arg_in_range) {
2712         jio_fprintf(defaultStream::error_stream(),
2713                     "Invalid thread stack size: %s\n", option->optionString);
2714         describe_range_error(errcode);
2715         return JNI_EINVAL;
2716       }
2717       // Internally track ThreadStackSize in units of 1024 bytes.
2718       FLAG_SET_CMDLINE(intx, ThreadStackSize,
2719                               round_to((int)long_ThreadStackSize, K) / K);




2667                     "Invalid initial heap size: %s\n", option->optionString);
2668         describe_range_error(errcode);
2669         return JNI_EINVAL;
2670       }
2671       FLAG_SET_CMDLINE(uintx, InitialHeapSize, (uintx)long_initial_heap_size);
2672       // Currently the minimum size and the initial heap sizes are the same.
2673       set_min_heap_size(InitialHeapSize);
2674     // -Xmx
2675     } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
2676       julong long_max_heap_size = 0;
2677       ArgsRange errcode = parse_memory_size(tail, &long_max_heap_size, 1);
2678       if (errcode != arg_in_range) {
2679         jio_fprintf(defaultStream::error_stream(),
2680                     "Invalid maximum heap size: %s\n", option->optionString);
2681         describe_range_error(errcode);
2682         return JNI_EINVAL;
2683       }
2684       FLAG_SET_CMDLINE(uintx, MaxHeapSize, (uintx)long_max_heap_size);
2685     // Xmaxf
2686     } else if (match_option(option, "-Xmaxf", &tail)) {
2687       char* err;
2688       int maxf = (int)(strtod(tail, &err) * 100);
2689       if (*err != '\0' || maxf < 0 || maxf > 100) {
2690         jio_fprintf(defaultStream::error_stream(),
2691                     "Bad max heap free percentage size: %s\n",
2692                     option->optionString);
2693         return JNI_EINVAL;
2694       } else {
2695         FLAG_SET_CMDLINE(uintx, MaxHeapFreeRatio, maxf);
2696       }
2697     // Xminf
2698     } else if (match_option(option, "-Xminf", &tail)) {
2699       char* err;
2700       int minf = (int)(strtod(tail, &err) * 100);
2701       if (*err != '\0' || minf < 0 || minf > 100) {
2702         jio_fprintf(defaultStream::error_stream(),
2703                     "Bad min heap free percentage size: %s\n",
2704                     option->optionString);
2705         return JNI_EINVAL;
2706       } else {
2707         FLAG_SET_CMDLINE(uintx, MinHeapFreeRatio, minf);
2708       }
2709     // -Xss
2710     } else if (match_option(option, "-Xss", &tail)) {
2711       julong long_ThreadStackSize = 0;
2712       ArgsRange errcode = parse_memory_size(tail, &long_ThreadStackSize, 1000);
2713       if (errcode != arg_in_range) {
2714         jio_fprintf(defaultStream::error_stream(),
2715                     "Invalid thread stack size: %s\n", option->optionString);
2716         describe_range_error(errcode);
2717         return JNI_EINVAL;
2718       }
2719       // Internally track ThreadStackSize in units of 1024 bytes.
2720       FLAG_SET_CMDLINE(intx, ThreadStackSize,
2721                               round_to((int)long_ThreadStackSize, K) / K);


src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File