Opened 16 years ago

Last modified 8 years ago

#74 closed defect (Fixed)

Servers bloat memory from spawned children

Reported by: arma Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: arma Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


When we fork, our children inherit the memory from the main Tor
process, which can be 50MB or more. Since it's copy-on-write, no
problem so far. But when the main Tor process changes the memory,
or frees it, then it gets copied so the child has a clean copy.

So we end up using 50+MB per child. When we spawn a lot of dnsworkers,
this becomes really bad.

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (3)

comment:1 Changed 16 years ago by nickm

Possible solutions:

  • use threads on more platforms, like we do on windows.
  • Free all resources after forking, and hope that our platform knows to brk() down to a smaller size. (We *do* this with out buffers, where most of the memory is.)
  • Fork a DNS/CPU parent immediately on Tor startup, and have that process fork more DNS/CPU workers as needed.

comment:2 Changed 15 years ago by arma

flyspray2trac: bug closed.
pthreads in 0.1.0 should resolve this.

comment:3 Changed 8 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.