Local work-around for Samba memory leak problem (fwd)

Gerald Carter gcarter at valinux.com
Wed May 30 22:43:15 GMT 2001

[Moved to Samba-technical...]


What version of Samba are you running?  Do you have a large printcap with
'load printers = yes'?


---------- Forwarded message ----------
Date: Wed, 30 May 2001 15:11:10 PDT
From: Keith Farrar <farrar at parc.xerox.com>
To: samba at lists.samba.org
Subject: Local work-around for Samba memory leak problem

The problem:
 Samba's smbd processes grow until they exhaust memory on our servers. The
process size and growth appears proportional to the number of volume share
definitions. One server has around 900 shared volumes, and its mate has
around 1500 (one for each NFS automounter map entry which refers to the
server). The standard Samba startup procedure used one master smbd daemon
which spawned a new child process for each new connection. Unfortunately,
the master daemon grows larger with time, leading its children to rapidly
exhaust virtual memory (as each child process inherits the full memory
footprint of its expanding parent). These small SPARC Solaris servers each
have 1 GB of RAM and 1 GB of swap space. They were running low on memory
(requiring smbd stop/start) one to four times per day.

I'm drowning in other work, so I haven't intrumented a running daemon with
a memory leak detector. But I needed to slow the rate of consumption so
that the servers continue to serve files and mail to their (500) clients.

The work-around:
 Install the xinetd service on the servers.
 Impose 25 MB limit on heap size in daemon startup environment (daemon
  will need around 10 MB, minimum, to run with 1500 shares).
 Start xinetd with smbd (netbios-ssn) service as its only enabled entry.

End result:
 Processes are killed by the kernel when they get too large (>25 MB), and
the windows clients's automatic reconnection will spawn replacements.

| Keith Farrar | Xerox PARC CSNS | Palo Alto, CA | 650-812-4292 |
| DOMAIN:  farrar at parc.xerox.com |                              |
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

More information about the samba-technical mailing list