Opened 14 years ago

Last modified 7 years ago

#74 closed defect (Fixed)

Servers bloat memory from spawned children

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

Description

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 14 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 14 years ago by arma

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

comment:3 Changed 7 years ago by nickm

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