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

Re: Various MiNT questions

  > 5.  What exactly is sharable code?  I thought it ment that one copy of a
  > program would be in memory instead of multiple copies.  That way, if all my
  > users have tcsh as their shell, then only one copy is in memory.  However, 
  > have noticed with tcsh that multiple copies run, and I quickly exaust
  > I see this after I log in and type "PS" and see one tcsh running.  Then I
  > rlogin or telnet to my machine again and type "PS" and now I see two tcsh,
  > for each login and each taking about 300k of memory.

  I think you're right about what shaable code is, but in order to be able to
  memory, a program has to be compiled sharable. Obviously this has not been do
  for tcsh. The most important problem in compiling programs sharable is that
  _all_ references must stay within 32 kB. This finetuning can be a lot of work
  I would like a sharable version of tcsh too.

Even the sharable version of tcsh will appear to take up 300K in a ps listing.
Tcsh uses a lot of space for shell variables and other such internal data
structures, and these cannot be shared between processes (obviously). The easy
way from the console to check memory usage is to check the Status button in
the General Setup CPX. You'll see that free memory doesn't really decrease by
300K when you start a new tcsh process. If you're really concerned about
memory use, use a simpler shell program. I use ash (the Bourne shell clone)
when I'm really tight on memory. I also have it installed as my /bin/sh for
those makefiles that actually cause a shell to be spawned...

If you double check, you will probably find that your tcsh actually *is*
sharable already. (Check the execution flags in the program header.)