diff --git a/db/db_impl.cc b/db/db_impl.cc index afd372012..db8e9aad5 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -634,13 +634,20 @@ void DBImpl::MaybeDumpStats() { default_cf_internal_stats_->GetStringProperty( *db_property_info, DB::Properties::kDBStats, &stats); } - if (immutable_db_options_.dump_malloc_stats) { - DumpMallocStats(&stats); - } Log(InfoLogLevel::WARN_LEVEL, immutable_db_options_.info_log, "------- DUMPING STATS -------"); Log(InfoLogLevel::WARN_LEVEL, immutable_db_options_.info_log, "%s", stats.c_str()); + if (immutable_db_options_.dump_malloc_stats) { + stats.clear(); + DumpMallocStats(&stats); + if (!stats.empty()) { + Log(InfoLogLevel::WARN_LEVEL, immutable_db_options_.info_log, + "------- Malloc STATS -------"); + Log(InfoLogLevel::WARN_LEVEL, immutable_db_options_.info_log, "%s", + stats.c_str()); + } + } #endif // !ROCKSDB_LITE PrintStatistics(); diff --git a/util/posix_logger.h b/util/posix_logger.h index ddad037e0..9450f3b92 100644 --- a/util/posix_logger.h +++ b/util/posix_logger.h @@ -80,7 +80,7 @@ class PosixLogger : public Logger { bufsize = sizeof(buffer); base = buffer; } else { - bufsize = 30000; + bufsize = 65536; base = new char[bufsize]; } char* p = base;