On Sat, Aug 19, 2000 at 05:10:00AM -0700, Trent Piepho wrote:
> What do you mean by multiple connections?  More than one connection request
> within some time window?  Does the process memory usage grow by some amount
> after each connection, or do there have to be more than one at a time for the
> memory to grow?

Karthik reported that there was a lag burst on each connection, and to
make it plain to me with my regular 900ms lag he decided to make many
connections at once.  I think he simply spawned ten telnet commands on
his well-connected machine.

I have not measured the rate of process memory usage yet against either
time or connections made.  I suspect it is unrelated to the number of
simultaneous connections.

> At this point, was the netrekd process 28MB, or still small?  What I mean is,
> does the CPU usage only happen when the memory leak has caused the process to
> get huge.

Yes, the CPU usage occurs seemly as a result of the memory leak.  This
implies that the virtual memory is being touched in a non-scaleable way
by some feature.

> Possibly.  I've looked over the newstartd code, and it's pretty nasty.  I
> already spotted one bug in a select() call, but I doubt that is the problem.

It was far worse until I hacked at it last year.
Let me know what that bug is.

> I don't know to do that easily either.  You could start it up in gdb and look
> at some variables.  For instance, you could look at the prog variable and see
> how many ports it thinks it has open, etc.

The contents of the prog array seem quite acceptable.  The gdb output
is included below.  This also gives us an idea of the number of
connections processed ... 23070 on the 2592 port.  If the leak relates
to connections, that's about 1k per connection.

Since August 15th, netrekd has grown to a VSZ of 5064 and RSZ of 3768.
The inl.real-time.com netrekd has grown to VSZ 5640 RSZ 4340 since Jul 3rd.
Restarting it gives VSZ 1664 and RSZ 628.

(gdb) p prog
$1 = {

{port = 2592, sock = 4, nargs = 0, 
    prog = "./ntserv", '\000' <repeats 503 times>, 
    progname = "ntserv", '\000' <repeats 505 times>, arg = {
      '\000' <repeats 63 times>, '\000' <repeats 63 times>, 
      '\000' <repeats 63 times>, '\000' <repeats 63 times>}, internal = 0, 
    accepts = 23070, denials = 0, forks = 23070, addr = 0}, 

{port = 2591, 
    sock = 5, nargs = 1, prog = "./tools/players", '\000' <repeats 496 times>, 
    progname = "players", '\000' <repeats 504 times>, arg = {
      "m", '\000' <repeats 62 times>, '\000' <repeats 63 times>, 
      '\000' <repeats 63 times>, '\000' <repeats 63 times>}, internal = 0, 
    accepts = 9017, denials = 0, forks = 9017, addr = 0}, 

{port = 2593, 
    sock = 6, nargs = 2, prog = "./ntserv", '\000' <repeats 503 times>, 
    progname = "ntservobs", '\000' <repeats 502 times>, arg = {
      "-q", '\000' <repeats 61 times>, "6", '\000' <repeats 62 times>, 
      '\000' <repeats 63 times>, '\000' <repeats 63 times>}, internal = 0, 
    accepts = 1853, denials = 0, forks = 1853, addr = 0}, 

{port = 0, sock = 0, 
    nargs = 0, prog = "special", '\000' <repeats 504 times>, 
    progname = '\000' <repeats 511 times>, arg = {'\000' <repeats 63 times>, 
      '\000' <repeats 63 times>, '\000' <repeats 63 times>, 
      '\000' <repeats 63 times>}, internal = 0, accepts = 0, denials = 0, 
    forks = 0, addr = 0}, 

{port = 0, sock = 0, nargs = 0, 
    prog = '\000' <repeats 511 times>, progname = '\000' <repeats 511 times>, 
    arg = {'\000' <repeats 63 times>, '\000' <repeats 63 times>, 
      '\000' <repeats 63 times>, '\000' <repeats 63 times>}, internal = 0, 
    accepts = 0, denials = 0, forks = 0, addr = 0} <repeats 12 times>}

-- 
James Cameron    mailto:quozl at us.netrek.org     http://quozl.netrek.org/