Opened 7 years ago

Closed 3 years ago

#9916 closed defect (fixed)

Gradually increasing memory usage on relay

Reported by: PB8iEL6NZhk4 Owned by:
Priority: Medium Milestone: Tor: 0.2.5.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-relay memory-leak
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Running tor (installed from the tor apt repo) as a relay on a debian squeeze VPS, and I notice a pattern of continuously increasing memory usage until it eats up all available ram and my VPS gets auto-rebooted by the host's maintenance scripts. Seems like there's a memory leak somewhere.

The VPS has 300MB of allocated ram. It takes roughly 3-5 days between reboots.

The relay is set with RelayBandwidthRate 150 KB, and RelayBandwidthBurst 300 KB. 

I'd be happy to provide any other details necessary to help fix this problem.

Child Tickets

Change History (5)

comment:1 Changed 7 years ago by nickm

Keywords: tor-relay memory-leak added; memory leak removed
Milestone: Tor: unspecified
Status: newneeds_information

Is the 0.2.4.x series any better for you? We're probably not going to be able to change how 0.2.3 handles RAM at this point in the 0.2.3 lifecycle.

On the other hand, if it *is* a simple memory leak, and you can run Tor for a while under valgrind, that would tell us where the leak is. (For information on how to do that, see instructions in doc/HACKING in the Tor repository, though you may need extra trickery to get it to work in a typical debian-based Tor installation.)

comment:2 Changed 7 years ago by nickm

I asked the debian package maintainer about running Tor in valgrind, and he said:

11:02 < weasel> ok.  I think the answer is:  become root, ulimit -n 100000, su 
                - debian-tor, valgrind <options> tor --defaults-torrc 
11:03 < weasel> that will detach though.  if you don't want that you probably 
                need more options or something

See doc/HACKING for a description of what <options> should be.

comment:3 Changed 7 years ago by PB8iEL6NZhk4

Well, I installed Going to let it run for a while and see how it behaves, before dealing with valgrind. Will report back in a few days.

Also, I can't change ulimit on my vps, it's some crippled openvz setup, or something. So if it comes to that, I hope it's not an absolutely necessary step for trying valgrind.

comment:4 Changed 7 years ago by PB8iEL6NZhk4

Well, after a couple of weeks of running it, it seems that it doesn't eat up memory - that's a big plus. :)

On the minus side though - whereas I used to have 800-900ish connections on, and avg transfers 50-70KB up and down, now connection count is roughly 200-300ish, and transfer speeds average around 20-30KB.

Not sure if that's expected behavior...

comment:5 Changed 3 years ago by nickm

Milestone: Tor: unspecifiedTor: 0.2.5.x-final
Resolution: fixed
Severity: Normal
Status: needs_informationclosed

Calling this probably fixed since 0.2.3 -- we've done a lot to limit and restrict memory usage since then, particularly in 0.2.5.

Note: See TracTickets for help on using tickets.