LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Telnet session consumes 8KB which is never released after session is terminated (http://www.linuxquestions.org/questions/linux-kernel-70/telnet-session-consumes-8kb-which-is-never-released-after-session-is-terminated-721231/)

NilesBor 04-23-2009 02:29 PM

Telnet session consumes 8KB which is never released after session is terminated
 
I am seeking assistance to this memory problem in Linux:

My distro: MontaVista version 2.6.10 (mvl401-ep852)

In "steady state", I execute the "free" command to display info about free and used memory on my system:

Code:

> free
              total        used        free      shared      buffers
  Mem:      127396        42884        84512            0            0
 Swap:            0            0            0
Total:      127396        42884        84512

I noted I have 84512 KB free. I then telnet into the kernel (via telnet <ip>) and note the following:

Two new processes are created for my telnet:
Code:

> ps
  PID  Uid    VmSize Stat Command
  250 root        884 S  in.telne
  251 root      1536 S  -bash

and memory is consumed:
Code:

> free
              total        used        free      shared      buffers
  Mem:      127396        43380        84016            0            0
 Swap:            0            0            0
Total:      127396        43380        84016

Then, I "exit" (terminate) my telnet session. Process 250 is removed but 251 has become a Zombie process:
Code:

> ps
  PID  Uid    VmSize Stat Command
  251 root            Z  [bash]

Also, all but 8K is freed (84512 - 84504 = 8 KB):
Code:

> free
              total        used        free      shared      buffers
  Mem:      127396        42892        84504            0            0
 Swap:            0            0            0
Total:      127396        42892        84504

I can repeat this process continuously and another 8K is used up never to be freed again (until I reboot the system). I have read up on Zombie processes and understand that it is a terminated process that has not been reaped by its parent. So, one cannot kill a Zombie process since it is already dead. And, I cannot kill the parent as it is already killed. I also read that it then becomes the responsiblity of the "init" process to watch over the Zombie processes and eventually zap them if the parent has not done so. But this doesn't seem to be happening in my system (the Zombie's are still here after almost a full day). I have concern from the end-user that memory is being eaten away every time someone logs in (albeit it is small, but it adds up).

I have patched the kernel with a recent patch tar file with no luck. Is this a known issue? I have tried this on another system and don't get this problem (memory is free'd cleanly). I'm open for any resolutions or opinions. Much thanks.

NilesBor 04-24-2009 11:14 AM

telnetd daemon
 
I have been looking at the differences in the telnet daemon on my system:

In /etc/inetd.conf:
Code:

telnet  stream  tcp    nowait  root    /usr/sbin/tcpd /usr/sbin/in.telnetd
On another system where things are fine, there is a difference:
Code:

telnet  stream  tcp    nowait  telnetd    /usr/sbin/telnetd  telnetd -l /bin/sh
I tried the telnetd instead of in.telnetd but I get a segmenation fault on my system. In both systems, the in.telnetd/telnetd is supplied by Busybox. However, in the system that works, they are using BusyBox v1.11.1 whereas I am using Busybox v1.01. Anyone know if there is a known problem in v1.01 wrt telnetd? Is it worth it for me to upgrade to v1.11.1 (or later)?


All times are GMT -5. The time now is 09:45 PM.