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

Unified Diff: net/spdy/spdy_session_pool.cc

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: rebased Created 3 years, 10 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
« no previous file with comments | « net/spdy/spdy_session_key.cc ('k') | net/spdy/spdy_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7af02fc5a331da6ea53ad42275b2055fcb5527e1 100644
--- a/net/spdy/spdy_session_pool.cc
+++ b/net/spdy/spdy_session_pool.cc
@@ -23,6 +23,10 @@
#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/platform/api/spdy_estimate_memory_usage.h"
#include "net/spdy/spdy_session.h"
namespace net {
@@ -381,14 +385,15 @@ 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 += SpdyEstimateMemoryUsage(ObtainHpackHuffmanTable()) +
+ SpdyEstimateMemoryUsage(ObtainHpackStaticTable());
base::trace_event::MemoryAllocatorDump* dump =
pmd->CreateAllocatorDump(base::StringPrintf(
"%s/spdy_session_pool", parent_dump_absolute_name.c_str()));
« no previous file with comments | « net/spdy/spdy_session_key.cc ('k') | net/spdy/spdy_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698