summaryrefslogtreecommitdiff
path: root/b1/743689c91b6218d44d60fc3aa56fb4ef8ec8bc
blob: 0e8aad8fedf10f26d35a210204b81b1cfe5c3970 (plain)
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
Return-Path: <j@toom.im>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 3C0378D8
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue, 13 Oct 2015 21:56:16 +0000 (UTC)
X-Greylist: from auto-whitelisted by SQLgrey-1.7.6
Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B527C112
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue, 13 Oct 2015 21:56:15 +0000 (UTC)
Received: from [192.168.1.190] (63.135.62.197.nwinternet.com [63.135.62.197]
	(may be forged)) (authenticated bits=0)
	by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t9DLuAjt027827
	(version=TLSv1 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
	Tue, 13 Oct 2015 14:56:11 -0700
From: "Jonathan Toomim (Toomim Bros)" <j@toom.im>
X-Pgp-Agent: GPGMail 2.5.2
Content-Type: multipart/signed;
	boundary="Apple-Mail=_18C4CD46-E054-4928-A12C-43A49C07A718";
	protocol="application/pgp-signature"; micalg=pgp-sha512
Date: Tue, 13 Oct 2015 14:56:08 -0700
Message-Id: <99C42DE7-814A-48F8-AB28-A5ADD77A9FD9@toom.im>
To: bitcoin-xt@googlegroups.com, bitcoin-dev@lists.linuxfoundation.org
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
X-Mailer: Apple Mail (2.1878.6)
X-Sonic-CAuth: UmFuZG9tSVaFKQzEFiEYfB6WWfMMhpgXTbCOPmSxNbWXm9kkz+RdLgKrdhn9LUg3lOZclWlD5Ar+tqC/FuUhFvRuoUgV72em
X-Sonic-ID: C;+onONvVx5RGKZb0U9jFv0A== M;VPeIN/Vx5RGKZb0U9jFv0A==
X-Sonic-Spam-Details: 0.0/5.0 by cerberusd
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE,
	RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Subject: [bitcoin-dev] Memory leaks?
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Bitcoin Development Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Oct 2015 21:56:16 -0000


--Apple-Mail=_18C4CD46-E054-4928-A12C-43A49C07A718
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_70B0E8D9-EB1D-4677-B01F-05F2EBBB9C6A"


--Apple-Mail=_70B0E8D9-EB1D-4677-B01F-05F2EBBB9C6A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

I just noticed that several of my running bitcoind processes were using =
around 3+ GB of RAM, even though the mempool itself seemed to be under =
control.

XXXX@prime:~/bin$ ./bitcoin-cli getmempoolinfo
{
    "size" : 1896,
    "bytes" : 37341328
}

[total memory usage not shown -- I restarted bitcoind as soon as I =
noticed, and didn't copy it down from top]

37 MB mempool, >3 GB RAM usage. Normally, when there aren't a lot of =
unconfirmed txns floating around the network, memory usage is around 600 =
MB, so this is quite unusual.

After restarting the process and letting it run for a few minutes, I =
get:

  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
[###] [XXXX]     20   0 1402M  317M 49836 S  1.0  8.2  0:41.71 =
./bitcoind -daemon

XXXX@prime:~/bin$ ./bitcoin-cli getmempoolinfo
{
    "size" : 1072,
    "bytes" : 670000
}

0.67 MB mempool, 317 MB RAM usage. Much more reasonable.


Here's another node I'm running that has been online longer, before =
restarting:

  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
[###] [XXXX]     20   0 4961M 3540M 11080 S  2.8 45.3  8h20:11 =
bin/bitcoind -daemon

XXXX@feather:~$ bin/bitcoin-cli getmempoolinfo
{
    "size" : 3045,
    "bytes" : 39656126
}

39 MB mempool, 3540 MB total memory usage. After restarting bitcoind, I =
see:

[XXXX]@feather:~$ bin/bitcoin-cli stop
Bitcoin server stopping
[XXXX]@feather:~$ bin/bitcoind -daemon
Bitcoin server starting
[XXXX]@feather:~$ sleep 10; bin/bitcoin-cli getmempoolinfo
{
    "size" : 39,
    "bytes" : 47037
}


  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
[###] [XXXX]     20   0 1640M  247M 67960 S  0.0  3.2  0:05.17 =
bin/bitcoind -daemon




Does anybody have any guesses where we might be leaking memory, or what =
is using the additional 2.4 GB? I've been using minrelaytxfee=3D0.00003 =
or similar on my nodes. Maybe there's a leak in the minrelaytxfee code =
path? Has anyone else seen something similar?

This issue appears to happen both with Bitcoin Core 0.10.1 and with =
Bitcoin XT 0.11B.

--Apple-Mail=_70B0E8D9-EB1D-4677-B01F-05F2EBBB9C6A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I just =
noticed that several of my running bitcoind processes were using around =
3+ GB of RAM, even though the mempool itself seemed to be under =
control.<div><br></div><div><div style=3D"margin: 0px; font-family: =
'Andale Mono'; color: rgb(41, 249, 20); background-color: rgb(0, 0, =
0);">XXXX@prime:~/bin$ ./bitcoin-cli getmempoolinfo</div><div =
style=3D"margin: 0px; font-family: 'Andale Mono'; color: rgb(41, 249, =
20); background-color: rgb(0, 0, 0);">{</div><div style=3D"margin: 0px; =
font-family: 'Andale Mono'; color: rgb(41, 249, 20); background-color: =
rgb(0, 0, 0);">&nbsp; &nbsp; "size" : 1896,</div><div style=3D"margin: =
0px; font-family: 'Andale Mono'; color: rgb(41, 249, 20); =
background-color: rgb(0, 0, 0);">&nbsp; &nbsp; "bytes" : =
37341328</div><div style=3D"margin: 0px; font-family: 'Andale Mono'; =
color: rgb(41, 249, 20); background-color: rgb(0, 0, =
0);">}</div></div><div><br></div><div>[total memory usage not shown -- I =
restarted bitcoind as soon as I noticed, and didn't copy it down from =
top]</div><div><br></div><div>37 MB mempool, &gt;3 GB RAM usage. =
Normally, when there aren't a lot of unconfirmed txns floating around =
the network, memory usage is around 600 MB, so this is quite =
unusual.</div><div><br></div><div>After restarting the process and =
letting it run for a few minutes, I get:</div><div><br></div><div><div =
style=3D"margin: 0px; font-family: 'Andale Mono'; background-color: =
rgb(0, 165, 0);">&nbsp;&nbsp;PID USER&nbsp; &nbsp; &nbsp; PRI&nbsp; =
NI&nbsp; VIRT &nbsp; RES &nbsp; SHR S CPU% <span =
style=3D"background-color: #00a6b2">MEM% </span>&nbsp; TIME+&nbsp; =
Command</div></div><div><div style=3D"margin: 0px; font-family: 'Andale =
Mono'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">[###] =
[XXXX] &nbsp; &nbsp;&nbsp;20 &nbsp; 0 <span style=3D"color: =
#34bbc7">1402M&nbsp; 317M 49</span>836 S&nbsp; 1.0&nbsp; 8.2&nbsp; =
0:41.71 ./bitcoind -daemon</div></div><div><br></div><div><div =
style=3D"margin: 0px; font-family: 'Andale Mono'; color: rgb(41, 249, =
20); background-color: rgb(0, 0, 0);">XXXX@prime:~/bin$ ./bitcoin-cli =
getmempoolinfo</div><div style=3D"margin: 0px; font-family: 'Andale =
Mono'; color: rgb(41, 249, 20); background-color: rgb(0, 0, =
0);">{</div><div style=3D"margin: 0px; font-family: 'Andale Mono'; =
color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">&nbsp; &nbsp; =
"size" : 1072,</div><div style=3D"margin: 0px; font-family: 'Andale =
Mono'; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">&nbsp; =
&nbsp; "bytes" : 670000</div><div style=3D"margin: 0px; font-family: =
'Andale Mono'; color: rgb(41, 249, 20); background-color: rgb(0, 0, =
0);">}</div></div><div><br></div><div>0.67 MB mempool, 317 MB RAM usage. =
Much more reasonable.</div><div><br></div><div><br></div><div>Here's =
another node I'm running that has been online longer, before =
restarting:</div><div><br></div><div><div style=3D"margin: 0px; =
font-family: 'Andale Mono'; background-color: rgb(0, 165, =
0);">&nbsp;&nbsp;PID USER&nbsp; &nbsp; &nbsp; PRI&nbsp; NI&nbsp; VIRT =
&nbsp; RES &nbsp; SHR S CPU% <span style=3D"background-color: =
#00a6b2">MEM% </span>&nbsp; TIME+&nbsp; Command</div><div style=3D"margin:=
 0px; font-family: 'Andale Mono'; color: rgb(41, 249, 20); =
background-color: rgb(0, 0, 0);">[###]&nbsp;<span style=3D"color: =
#000000">[XXXX]&nbsp;&nbsp; &nbsp;</span> 20 &nbsp; 0 <span =
style=3D"color: #34bbc7">4961M 3540M 11</span>080 S&nbsp; 2.8 =
45.3&nbsp;<span style=3D"color: #c33720"> 8h</span>20:11 bin/bitcoind =
-daemon</div></div><div><br></div><div><div style=3D"margin: 0px; =
font-family: 'Andale Mono'; color: rgb(41, 249, 20); background-color: =
rgb(0, 0, 0);">XXXX@feather:~$ bin/bitcoin-cli getmempoolinfo</div><div =
style=3D"margin: 0px; font-family: 'Andale Mono'; color: rgb(41, 249, =
20); background-color: rgb(0, 0, 0);">{</div><div style=3D"margin: 0px; =
font-family: 'Andale Mono'; color: rgb(41, 249, 20); background-color: =
rgb(0, 0, 0);">&nbsp; &nbsp; "size" : 3045,</div><div style=3D"margin: =
0px; font-family: 'Andale Mono'; color: rgb(41, 249, 20); =
background-color: rgb(0, 0, 0);">&nbsp; &nbsp; "bytes" : =
39656126</div><div style=3D"margin: 0px; font-family: 'Andale Mono'; =
color: rgb(41, 249, 20); background-color: rgb(0, 0, =
0);">}</div></div><div><br></div><div>39 MB mempool, 3540 MB total =
memory usage. After restarting bitcoind, I =
see:</div><div><br></div><div><div style=3D"margin: 0px; font-family: =
'Andale Mono'; color: rgb(41, 249, 20); background-color: rgb(0, 0, =
0);">[XXXX]@feather:~$ bin/bitcoin-cli stop</div><div style=3D"margin: =
0px; font-family: 'Andale Mono'; color: rgb(41, 249, 20); =
background-color: rgb(0, 0, 0);">Bitcoin server stopping</div><div =
style=3D"margin: 0px; font-family: 'Andale Mono'; color: rgb(41, 249, =
20); background-color: rgb(0, 0, 0);">[XXXX]@feather:~$ bin/bitcoind =
-daemon</div><div style=3D"margin: 0px; font-family: 'Andale Mono'; =
color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">Bitcoin server =
starting</div><div style=3D"margin: 0px; font-family: 'Andale Mono'; =
color: rgb(41, 249, 20); background-color: rgb(0, 0, =
0);">[XXXX]@feather:~$ sleep 10; bin/bitcoin-cli =
getmempoolinfo</div><div style=3D"margin: 0px; font-family: 'Andale =
Mono'; color: rgb(41, 249, 20); background-color: rgb(0, 0, =
0);">{</div><div style=3D"margin: 0px; font-family: 'Andale Mono'; =
color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">&nbsp; &nbsp; =
"size" : 39,</div><div style=3D"margin: 0px; font-family: 'Andale Mono'; =
color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);">&nbsp; &nbsp; =
"bytes" : 47037</div><div style=3D"margin: 0px; font-family: 'Andale =
Mono'; color: rgb(41, 249, 20); background-color: rgb(0, 0, =
0);">}</div></div><div><br></div><div><br></div><div><div style=3D"margin:=
 0px; font-family: 'Andale Mono'; background-color: rgb(0, 165, =
0);">&nbsp;&nbsp;PID USER&nbsp; &nbsp; &nbsp; PRI&nbsp; NI&nbsp; VIRT =
&nbsp; RES &nbsp; SHR S CPU% <span style=3D"background-color: =
#00a6b2">MEM% </span>&nbsp; TIME+&nbsp; Command</div><div style=3D"margin:=
 0px; font-family: 'Andale Mono'; color: rgb(41, 249, 20); =
background-color: rgb(0, 0, 0);">[###] [XXXX] &nbsp; &nbsp;&nbsp;20 =
&nbsp; 0 <span style=3D"color: rgb(52, 187, 199);">1640M&nbsp; 247M =
67</span>960 S&nbsp; 0.0&nbsp; 3.2&nbsp; 0:05.17 bin/bitcoind =
-daemon</div></div><div><br></div><div><br></div><div><br></div><div><br><=
/div><div>Does anybody have any guesses where we might be leaking =
memory, or what is using the additional 2.4 GB? I've been =
using&nbsp;<span style=3D"background-color: rgb(0, 0, 0); color: rgb(41, =
249, 20); font-family: 'Andale =
Mono';">minrelaytxfee=3D0.00003</span>&nbsp;or similar on my nodes. =
Maybe there's a leak in the minrelaytxfee code path? Has anyone else =
seen something similar?</div><div><br></div><div>This issue appears to =
happen both with Bitcoin Core 0.10.1 and with Bitcoin XT =
0.11B.</div></body></html>=

--Apple-Mail=_70B0E8D9-EB1D-4677-B01F-05F2EBBB9C6A--

--Apple-Mail=_18C4CD46-E054-4928-A12C-43A49C07A718
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQEcBAEBCgAGBQJWHX36AAoJEIEuMk4MG0P1058IAKdGQtC5prZUSlTsaWBPBYVu
+F1Hu5K9Mf09SOgvsphUnviW6n1yxdA9RZIeaiEHCIbTCvaVZ/RaVY1LxRbSXYHI
LcK32+Px0x8tVacRpzCzRlWMRb8MjhLjrqbV4JZiHXN+jsoUen/flsrXXlEq6CKw
tqSt3MtctzQbm8rNsEGcnYFApCTJNSsEhD1la8mDRQEgo5FfqeM1RAoCmt0i1Wk/
XmOSbFqKqfOXXHn5oLk4baOQXprG5fErEWrNplswcoeoIQCDfGKWOP+WUfhPfRUf
pTiQdkuhMZQgEnffQwfJEZGghlA9Xr9Vy5G3Di/J6GOzjzrxZFhJBX91iRJvXW8=
=jD7S
-----END PGP SIGNATURE-----

--Apple-Mail=_18C4CD46-E054-4928-A12C-43A49C07A718--