Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: net/spdy/spdy_session_pool.cc

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: address bnc comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/spdy/spdy_session_pool.cc
diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc
index 1a594d0cb7bda48e16f9926124411e1d5e370a12..972dc32bd355ce12797f7b05e7af5dda0255bcdd 100644
--- a/net/spdy/spdy_session_pool.cc
+++ b/net/spdy/spdy_session_pool.cc
@@ -13,6 +13,7 @@
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/memory_allocator_dump.h"
+#include "base/trace_event/memory_usage_estimator.h"
#include "base/trace_event/process_memory_dump.h"
#include "base/trace_event/trace_event.h"
#include "base/values.h"
@@ -23,6 +24,9 @@
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_source.h"
#include "net/log/net_log_with_source.h"
+#include "net/spdy/hpack/hpack_constants.h"
+#include "net/spdy/hpack/hpack_huffman_table.h"
+#include "net/spdy/hpack/hpack_static_table.h"
#include "net/spdy/spdy_session.h"
namespace net {
@@ -381,14 +385,16 @@ void SpdySessionPool::DumpMemoryStats(
for (const auto& session : sessions_) {
StreamSocket::SocketMemoryStats stats;
bool is_session_active = false;
- session->DumpMemoryStats(&stats, &is_session_active);
- total_size += stats.total_size;
+ total_size += session->DumpMemoryStats(&stats, &is_session_active);
buffer_size += stats.buffer_size;
cert_count += stats.cert_count;
serialized_cert_size += stats.serialized_cert_size;
if (is_session_active)
num_active_sessions++;
}
+ total_size +=
+ base::trace_event::EstimateMemoryUsage(ObtainHpackHuffmanTable()) +
+ base::trace_event::EstimateMemoryUsage(ObtainHpackStaticTable());
base::trace_event::MemoryAllocatorDump* dump =
pmd->CreateAllocatorDump(base::StringPrintf(
"%s/spdy_session_pool", parent_dump_absolute_name.c_str()));

Powered by Google App Engine
This is Rietveld 408576698