[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why is dictd so large?



Dylan Paul Thurston <dpt@math.berkeley.edu> writes:

> On Mon, Feb 28, 2000 at 10:15:26AM -0500, Bob Hilliard wrote:
> > Dylan Paul Thurston <dpt@math.berkeley.edu> writes:
> > 
> > > After upgrading to unstable, I noticed that dictd seems to be rather
> > > excessively large: it's taking up 8 megabytes at the moment.  Is this
> > > normal?  (I have all the free dictionaries installed.)
> > > 
> > > Thanks,
> > > 	Dylan Thurston
> > > 
> > > (Please CC: me on replies.)
> > 
> > 
> >      According to my build directory, the entire dictd package, source
> > + binaries, totals 752 kb.  The combined installed size of the two
> > .debs is about 453 kb.  I have just checked the archives, and this
> > .debs on master are the same size as those in my build directory.
> 
> Oops, I forgot to say that I was talking about memory usage.  Here's
> the output of top:
> 
>   PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
> ...
> 26313 nobody     0   0  8600 8600  7692 S       0  0.0  8.9   0:00 dictd
> 
> It's the second largest process on my system, second only to XF86.
 
     What version of dictd are you using?  I have 1.4.9-6 installed on
my system.  The first time I run top after a reboot it reports: 
 
PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
  129 nobody     0   0   904    0     0 SW      0  0.0  0.0   0:00 dictd

     After I make a dict query, this becomes:

  129 nobody     1   0   996  136   116 S       0  0.0  0.1   0:00 dictd
 
     This doesn't change as additional dict queries are made.
However, it isn't constant.  Earlier today, top reported 1074 size and
238 RSS, but I have since rebooted.  

     I have just tried restarting dictd using `/etc/init.d/dictd/
restart'.  The memory usage reported by top jumped up to the same
value you report.  Restart is implemented in dictd by stopping and
restarting the daemon, so `/etc/init.d/dictd stop' followed by
`/etc/init.d/dictd start' produces the same results.

     I have no idea why this works this way, but will try to find
out.  When dictd is started, it drops permissions and becomes nobody,
then forks.  As soon as the child process starts, the original dies.
Whenever a dict query is received, it forks a new child to handle
the request, which exits as soon as it responds to the query.

     Let me know of any further information regarding this that you
discover.  Thanks for your report.

Bob
-- 
   _
  |_)  _  |_       Robert D. Hilliard    <hilliard@flinet.com>
  |_) (_) |_)      Palm City, FL  USA    PGP Key ID: A8E40EB9


Reply to: