src/share/vm/utilities/ostream.hpp

Print this page

        

*** 113,123 **** void print_julong(julong value); // flushing virtual void flush() {} virtual void write(const char* str, size_t len) = 0; ! virtual void rotate_log() {} // GC log rotation virtual ~outputStream() {} // close properly on deletion void dec_cr() { dec(); cr(); } void inc_cr() { inc(); cr(); } }; --- 113,123 ---- void print_julong(julong value); // flushing virtual void flush() {} virtual void write(const char* str, size_t len) = 0; ! virtual void rotate_log(bool force, outputStream* out = NULL) {} // GC log rotation virtual ~outputStream() {} // close properly on deletion void dec_cr() { dec(); cr(); } void inc_cr() { inc(); cr(); } };
*** 238,249 **** uintx _cur_file_num; // current logfile rotation number, from 0 to NumberOfGCLogFiles-1 public: gcLogFileStream(const char* file_name); ~gcLogFileStream(); virtual void write(const char* c, size_t len); ! virtual void rotate_log(); void dump_loggc_header(); }; #ifndef PRODUCT // unit test for checking -Xloggc:<filename> parsing result void test_loggc_filename(); --- 238,256 ---- uintx _cur_file_num; // current logfile rotation number, from 0 to NumberOfGCLogFiles-1 public: gcLogFileStream(const char* file_name); ~gcLogFileStream(); virtual void write(const char* c, size_t len); ! virtual void rotate_log(bool force, outputStream* out = NULL); void dump_loggc_header(); + + /* If "force" sets true, force log file rotation from outside JVM */ + bool should_rotate(bool force) { + return force || + ((GCLogFileSize != 0) && ((uintx)_bytes_written >= GCLogFileSize)); + } + }; #ifndef PRODUCT // unit test for checking -Xloggc:<filename> parsing result void test_loggc_filename();