[tor-bugs] #24806 [Core Tor/Tor]: LTS branch leaks memory continuously under stress/attack, requires back-port of 0.3.2.8-rc fixes to remain viable

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Jan 8 07:01:19 UTC 2018


#24806: LTS branch leaks memory continuously under stress/attack, requires back-
port of 0.3.2.8-rc fixes to remain viable
--------------------------+------------------------
 Reporter:  starlight     |          Owner:  (none)
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+------------------------

Comment (by arma):

 To be clear, there's a good chance that this is not a memory leak.

 Instead, it is more likely that it is memory fragmentation.

 For context, when a program mallocs some memory, it gets a page of memory
 to itself, and further mallocs come out of that page, or maybe a new page,
 depending on complex algorithms inside the kernel. When the program frees
 chunks of memory, the kernel can't reclaim the page and give it to a
 different program until all of the chunks of memory on that page have been
 freed. So if you have an unfortunate pattern of allocations and frees, it
 can result in a larger and larger set of pages that are reserved for your
 program, even though you freed a bunch of the stuff that you allocated.

 That pattern is why you see the Tor process growing over time and rarely
 shrinking.

 The fix is generally hard. It involves identifying what patterns are
 causing inefficient usage of pages, and changing how Tor behaves to avoid
 those patterns.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24806#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list