aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/rcrowley/go-metrics/memory.md
blob: 47454f54b640945daabbdcd73bbe4e017f886e75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
Memory usage
============

(Highly unscientific.)

Command used to gather static memory usage:

```sh
grep ^Vm "/proc/$(ps fax | grep [m]etrics-bench | awk '{print $1}')/status"
```

Program used to gather baseline memory usage:

```go
package main

import "time"

func main() {
    time.Sleep(600e9)
}
```

Baseline
--------

```
VmPeak:    42604 kB
VmSize:    42604 kB
VmLck:         0 kB
VmHWM:      1120 kB
VmRSS:      1120 kB
VmData:    35460 kB
VmStk:       136 kB
VmExe:      1020 kB
VmLib:      1848 kB
VmPTE:        36 kB
VmSwap:        0 kB
```

Program used to gather metric memory usage (with other metrics being similar):

```go
package main

import (
    "fmt"
    "metrics"
    "time"
)

func main() {
    fmt.Sprintf("foo")
    metrics.NewRegistry()
    time.Sleep(600e9)
}
```

1000 counters registered
------------------------

```
VmPeak:    44016 kB
VmSize:    44016 kB
VmLck:         0 kB
VmHWM:      1928 kB
VmRSS:      1928 kB
VmData:    36868 kB
VmStk:       136 kB
VmExe:      1024 kB
VmLib:      1848 kB
VmPTE:        40 kB
VmSwap:        0 kB
```

**1.412 kB virtual, TODO 0.808 kB resident per counter.**

100000 counters registered
--------------------------

```
VmPeak:    55024 kB
VmSize:    55024 kB
VmLck:         0 kB
VmHWM:     12440 kB
VmRSS:     12440 kB
VmData:    47876 kB
VmStk:       136 kB
VmExe:      1024 kB
VmLib:      1848 kB
VmPTE:        64 kB
VmSwap:        0 kB
```

**0.1242 kB virtual, 0.1132 kB resident per counter.**

1000 gauges registered
----------------------

```
VmPeak:    44012 kB
VmSize:    44012 kB
VmLck:         0 kB
VmHWM:      1928 kB
VmRSS:      1928 kB
VmData:    36868 kB
VmStk:       136 kB
VmExe:      1020 kB
VmLib:      1848 kB
VmPTE:        40 kB
VmSwap:        0 kB
```

**1.408 kB virtual, 0.808 kB resident per counter.**

100000 gauges registered
------------------------

```
VmPeak:    55020 kB
VmSize:    55020 kB
VmLck:         0 kB
VmHWM:     12432 kB
VmRSS:     12432 kB
VmData:    47876 kB
VmStk:       136 kB
VmExe:      1020 kB
VmLib:      1848 kB
VmPTE:        60 kB
VmSwap:        0 kB
```

**0.12416 kB virtual, 0.11312 resident per gauge.**

1000 histograms with a uniform sample size of 1028
--------------------------------------------------

```
VmPeak:    72272 kB
VmSize:    72272 kB
VmLck:         0 kB
VmHWM:     16204 kB
VmRSS:     16204 kB
VmData:    65100 kB
VmStk:       136 kB
VmExe:      1048 kB
VmLib:      1848 kB
VmPTE:        80 kB
VmSwap:        0 kB
```

**29.668 kB virtual, TODO 15.084 resident per histogram.**

10000 histograms with a uniform sample size of 1028
---------------------------------------------------

```
VmPeak:   256912 kB
VmSize:   256912 kB
VmLck:         0 kB
VmHWM:    146204 kB
VmRSS:    146204 kB
VmData:   249740 kB
VmStk:       136 kB
VmExe:      1048 kB
VmLib:      1848 kB
VmPTE:       448 kB
VmSwap:        0 kB
```

**21.4308 kB virtual, 14.5084 kB resident per histogram.**

50000 histograms with a uniform sample size of 1028
---------------------------------------------------

```
VmPeak:   908112 kB
VmSize:   908112 kB
VmLck:         0 kB
VmHWM:    645832 kB
VmRSS:    645588 kB
VmData:   900940 kB
VmStk:       136 kB
VmExe:      1048 kB
VmLib:      1848 kB
VmPTE:      1716 kB
VmSwap:     1544 kB
```

**17.31016 kB virtual, 12.88936 kB resident per histogram.**

1000 histograms with an exponentially-decaying sample size of 1028 and alpha of 0.015
-------------------------------------------------------------------------------------

```
VmPeak:    62480 kB
VmSize:    62480 kB
VmLck:         0 kB
VmHWM:     11572 kB
VmRSS:     11572 kB
VmData:    55308 kB
VmStk:       136 kB
VmExe:      1048 kB
VmLib:      1848 kB
VmPTE:        64 kB
VmSwap:        0 kB
```

**19.876 kB virtual, 10.452 kB resident per histogram.**

10000 histograms with an exponentially-decaying sample size of 1028 and alpha of 0.015
--------------------------------------------------------------------------------------

```
VmPeak:   153296 kB
VmSize:   153296 kB
VmLck:         0 kB
VmHWM:    101176 kB
VmRSS:    101176 kB
VmData:   146124 kB
VmStk:       136 kB
VmExe:      1048 kB
VmLib:      1848 kB
VmPTE:       240 kB
VmSwap:        0 kB
```

**11.0692 kB virtual, 10.0056 kB resident per histogram.**

50000 histograms with an exponentially-decaying sample size of 1028 and alpha of 0.015
--------------------------------------------------------------------------------------

```
VmPeak:   557264 kB
VmSize:   557264 kB
VmLck:         0 kB
VmHWM:    501056 kB
VmRSS:    501056 kB
VmData:   550092 kB
VmStk:       136 kB
VmExe:      1048 kB
VmLib:      1848 kB
VmPTE:      1032 kB
VmSwap:        0 kB
```

**10.2932 kB virtual, 9.99872 kB resident per histogram.**

1000 meters
-----------

```
VmPeak:    74504 kB
VmSize:    74504 kB
VmLck:         0 kB
VmHWM:     24124 kB
VmRSS:     24124 kB
VmData:    67340 kB
VmStk:       136 kB
VmExe:      1040 kB
VmLib:      1848 kB
VmPTE:        92 kB
VmSwap:        0 kB
```

**31.9 kB virtual, 23.004 kB resident per meter.**

10000 meters
------------

```
VmPeak:   278920 kB
VmSize:   278920 kB
VmLck:         0 kB
VmHWM:    227300 kB
VmRSS:    227300 kB
VmData:   271756 kB
VmStk:       136 kB
VmExe:      1040 kB
VmLib:      1848 kB
VmPTE:       488 kB
VmSwap:        0 kB
```

**23.6316 kB virtual, 22.618 kB resident per meter.**