--- old/src/share/vm/logging/logConfiguration.cpp 2016-05-03 22:43:56.084411820 +0900 +++ new/src/share/vm/logging/logConfiguration.cpp 2016-05-03 22:43:55.917412401 +0900 @@ -464,7 +464,7 @@ " -Xlog:gc=debug:file=gc.txt:none\n" "\t Log messages tagged with 'gc' tag using 'debug' level to file 'gc.txt' with no decorations.\n\n" - " -Xlog:gc=trace:file=gctrace.txt:uptimemillis,pids:filecount=5,filesize=1024\n" + " -Xlog:gc=trace:file=gctrace.txt:uptimemillis,pids:filecount=5,filesize=1m\n" "\t Log messages tagged with 'gc' tag using 'trace' level to a rotating fileset of 5 files of size 1MB,\n" "\t using the base name 'gctrace.txt', with 'uptimemillis' and 'pid' decorations.\n\n" --- old/src/share/vm/logging/logFileOutput.cpp 2016-05-03 22:43:56.791409358 +0900 +++ new/src/share/vm/logging/logFileOutput.cpp 2016-05-03 22:43:56.647409859 +0900 @@ -26,6 +26,7 @@ #include "logging/logConfiguration.hpp" #include "logging/logFileOutput.hpp" #include "memory/allocation.inline.hpp" +#include "runtime/arguments.hpp" #include "runtime/os.inline.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/defaultStream.hpp" @@ -187,14 +188,15 @@ } _file_count = static_cast(value); } else if (strcmp(FileSizeOptionKey, key) == 0) { - size_t value = parse_value(value_str); - if (value == SIZE_MAX || value > SIZE_MAX / K) { + success = Arguments::atojulong(value_str, &_rotate_size); + if (!success) { + break; + } else if (_rotate_size > SIZE_MAX) { errstream->print_cr("Invalid option: %s must be in range [0, " - SIZE_FORMAT "]", FileSizeOptionKey, SIZE_MAX / K); + SIZE_FORMAT "]", FileSizeOptionKey, SIZE_MAX); success = false; break; } - _rotate_size = value * K; } else { errstream->print_cr("Invalid option '%s' for log file output.", key); success = false; --- old/src/share/vm/logging/logFileOutput.hpp 2016-05-03 22:43:57.514406840 +0900 +++ new/src/share/vm/logging/logFileOutput.hpp 2016-05-03 22:43:57.365407359 +0900 @@ -40,7 +40,7 @@ static const char* TimestampFilenamePlaceholder; static const char* TimestampFormat; static const size_t DefaultFileCount = 5; - static const size_t DefaultFileSize = 20 * M; + static const julong DefaultFileSize = 20 * M; static const size_t StartTimeBufferSize = 20; static const size_t PidBufferSize = 21; static const uint MaxRotationFileCount = 1000; @@ -56,8 +56,8 @@ uint _file_count_max_digits; size_t _archive_name_len; - size_t _rotate_size; - size_t _current_size; + julong _rotate_size; + julong _current_size; // Semaphore used for synchronizing file rotations and writes Semaphore _rotation_semaphore; --- old/src/share/vm/runtime/arguments.cpp 2016-05-03 22:43:58.225404365 +0900 +++ new/src/share/vm/runtime/arguments.cpp 2016-05-03 22:43:58.065404922 +0900 @@ -778,8 +778,8 @@ return path; } -// Parses a memory size specification string. -static bool atomull(const char *s, julong* result) { +// Parses a size specification string. +bool Arguments::atojulong(const char *s, julong* result) { julong n = 0; int args_read = 0; bool is_hex = false; @@ -885,7 +885,7 @@ return false; } - // Check the sign first since atomull() parses only unsigned values. + // Check the sign first since atojulong() parses only unsigned values. if (*value == '-') { if (!result->is_intx() && !result->is_int()) { return false; @@ -893,7 +893,7 @@ value++; is_neg = true; } - if (!atomull(value, &v)) { + if (!Arguments::atojulong(value, &v)) { return false; } if (result->is_int()) { @@ -2693,12 +2693,12 @@ uintx* uintx_arg, uintx min_size) { - // Check the sign first since atomull() parses only unsigned values. + // Check the sign first since atojulong() parses only unsigned values. bool value_is_positive = !(*value == '-'); if (value_is_positive) { julong n; - bool good_return = atomull(value, &n); + bool good_return = atojulong(value, &n); if (good_return) { bool above_minimum = n >= min_size; bool value_is_too_large = n > max_uintx; @@ -2715,7 +2715,7 @@ Arguments::ArgsRange Arguments::parse_memory_size(const char* s, julong* long_arg, julong min_size) { - if (!atomull(s, long_arg)) return arg_unreadable; + if (!atojulong(s, long_arg)) return arg_unreadable; return check_memory_size(*long_arg, min_size); } --- old/src/share/vm/runtime/arguments.hpp 2016-05-03 22:43:59.052401485 +0900 +++ new/src/share/vm/runtime/arguments.hpp 2016-05-03 22:43:58.911401976 +0900 @@ -729,6 +729,8 @@ static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen); static void check_unsupported_dumping_properties() NOT_CDS_RETURN; + + static bool atojulong(const char *s, julong* result); }; // Disable options not supported in this release, with a warning if they --- old/test/serviceability/logging/TestLogRotation.java 2016-05-03 22:43:59.649399406 +0900 +++ new/test/serviceability/logging/TestLogRotation.java 2016-05-03 22:43:59.510399890 +0900 @@ -75,7 +75,7 @@ ArrayList args = new ArrayList(); String[] logOpts = new String[]{ "-cp", System.getProperty("java.class.path"), - "-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + ",filecount=" + numberOfFiles, + "-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + "k,filecount=" + numberOfFiles, "-XX:-DisableExplicitGC", // to ensure that System.gc() works "-Xmx128M"}; // System.getProperty("test.java.opts") is '' if no options is set