blob: 6a3278db1a616a6c16c8647f089748d9f7d9726d [file] [log] [blame] [view]
xunjieli629230d2017-06-21 19:14:141# Network Stack Memory Tracing
2
3This is an overview of the Net column in [MemoryInfra][memory-infra].
4
5[TOC]
6
7## Quick Start
8
9To get an overview of total network stack memory usage, select the Browser
10process' *net* category and look at *effective_size* or *size* column.
11
12![net stack column][net-stack-column]
13
14[memory-infra]: README.md
15[net-stack-column]: https://storage.googleapis.com/chromium-docs.appspot.com/net_category.png
16
17## Detailed Information
18
19The numbers are reported by the network stack’s MemoryDumpProvider, which is
20implemented by URLRequestContext class. URLRequestContext calls into major
21network stack objects (such as HttpNetworkSession, SSLClientSessionCache,
22HttpCache) to aggregate memory usage numbers. The total number reported in
23“net” is a lower bound of the memory used by the network stack. It is not
24intended to be an accurate measurement. Please use
25[heap profiler][heap-profiler] instead to see all allocations.
26
27**URLRequestContext** (“url_request_context”)
28
29This is a top-level network stack object used to create url requests. There are
30several URLRequestContexts in Chrome. See
31[Anatomy of the Network Stack][anatomy-of-network-stack] for what these
32URLRequestContexts are created for. The number of URLRequestContexts increases
33with the number of profiles.
34
35For a “url_request_context” row, the “object_count” column indicates the number
36of live URLRequests created by that context.
37
38+ Sub rows
39
40 - HttpCache (“http_cache”)
41
42 This cache can be a disk cache (backed by either block file or simple
43 cache backend) or an in-memory cache. An incognito profile, for example,
44 has an in-memory HttpCache. You can tell this by whether
45 *mem_backend_size* column is present for that particular
46 URLRequestContext.
47
48
49**HttpNetworkSession** (“http_network_session”)
50
51This network stack object owns socket pools, the HTTP/2 and QUIC session pools.
52There is usually a 1:1 correspondence from a URLRequestContext to an
53HttpNetworkSession, but there are exceptions. For example, the “main”
54URLRequestContext shares the same HttpNetworkSession with “main_media”
55URLRequestContext and “main_isolated_media” URLRequestContext.
56
57+ Sub rows
58
59 - HttpStreamFactory(“stream_factory”)
60
61 This object is an entry to establish HTTP/1.1, HTTP/2 and QUIC
62 connections.
63
64 - SpdySessionPool (“spdy_session_pool”)
65
66 This object owns HTTP/2 sessions.
67
Dustin J. Mitchell795c7362024-01-18 16:50:5268 - QuicSessionPool (“quic_session_pool”)
xunjieli629230d2017-06-21 19:14:1469
70 This object owns QUIC sessions and streams.
71
72**SSLClientSessionCache** (“ssl_session_cache”)
73
74This is a global singleton that caches SSL session objects which retain
75references to refcounted SSL Certificates.
76
77[heap-profiler]: /docs/memory-infra/heap_profiler.md
78[anatomy-of-network-stack]: /net/docs/life-of-a-url-request.md
79