Commit 9eecc6a
committed
Fix memory leak
Every time the collector is scraped, it makes a new connection. The
connection is never cleaned up, even if you add a conn.close() after
the scrape [1]. This is a likely bug.
This patch moves to using the instance connection, which works around
the leak and is more efficient.1 parent 09f29d9 commit 9eecc6a
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | 342 | | |
344 | 343 | | |
345 | 344 | | |
346 | | - | |
| 345 | + | |
347 | 346 | | |
348 | 347 | | |
349 | 348 | | |
| |||
355 | 354 | | |
356 | 355 | | |
357 | 356 | | |
358 | | - | |
| 357 | + | |
359 | 358 | | |
360 | 359 | | |
361 | 360 | | |
| |||
366 | 365 | | |
367 | 366 | | |
368 | 367 | | |
369 | | - | |
| 368 | + | |
370 | 369 | | |
371 | 370 | | |
372 | 371 | | |
| |||
0 commit comments