? about using multi-level menu system using dispatch method

? about using multi-level menu system using dispatch method

am 09.04.2008 18:25:58 von mmccaws2

It's a general question on how do I make sure that I'm not eating up
memory unnecessarily. I have a script that is used as a user
interface to:
monitoring the status of application's several scripts,
stopping, starting, and creating projects within the application

A project is defined as the set of actions required to be implemented
by the collection of scripts. All the settings are stored in a DB by
this script, then the script can start and stop the application's set
of scripts.

The question is how do I make sure that I'm not unnecessarily eating
memory (is this what you may call creating zombies?). How do I go
about monitoring those resources. Is there a good link or book
addressing this?

Thanks
Mike

Re: ? about using multi-level menu system using dispatch method

am 09.04.2008 18:45:06 von RedGrittyBrick

mmccaws2 wrote:
> It's a general question

This is a general answer.

> on how do I make sure that I'm not eating up
> memory unnecessarily.

My first step would be to find out if, in fact, memory is being eaten up
uneccessarily. I'd monitor the program over an extended period of time
using the tools provided by the operating system that show the program's
memory usage.


> I have a script that is used as a user
> interface to:
> monitoring the status of application's several scripts,
> stopping, starting, and creating projects within the application
>
> A project is defined as the set of actions required to be implemented
> by the collection of scripts. All the settings are stored in a DB by
> this script, then the script can start and stop the application's set
> of scripts.


> The question is how do I make sure that I'm not unnecessarily eating
> memory (is this what you may call creating zombies?).

Processes on a Unix-like operating system which have finished their work
wait to tell their parents their exit code - they wait for their parent
to "reap" them. If the parents have lost interest in them, the parents
never "reap" the children and the children, have finished (died) but are
unable to part the mortal plane - they are zombies. This is usually the
result of a programming bug (usually in your program rather than the
language/compiler etc).

AFAIK zombies usually consume minimal resources in terms of memory, etc,
but occupy slots in the process table such that it if they multiply in
an unlimited way, the OS may eventually be unable to start any new
process due to lack of resources (like process table slots). It is a
long time since I first encountered this so the details may differ in
current OSs.

If you get the parents to exit/restart (in the worst case use `kill`)
the zombies will be inherited by the "init" process which will reap them
and make them go away.


> How do I go about monitoring those resources.

How I'd do it depends on
* which resources
* which operating system

--
RGB

Re: ? about using multi-level menu system using dispatch method

am 09.04.2008 21:10:05 von Chris Mattern

On 2008-04-09, RedGrittyBrick wrote:

>
> AFAIK zombies usually consume minimal resources in terms of memory, etc,

Zombies consume *no* resources. A zombie process is an entry in the
process table with a return code, nothing more. They consume no
resources whatsoever other than the process table entry.

> but occupy slots in the process table such that it if they multiply in
> an unlimited way, the OS may eventually be unable to start any new
> process due to lack of resources (like process table slots). It is a
> long time since I first encountered this so the details may differ in
> current OSs.

This is correct. The only way zombies can actually hurt the system
is if they actually starve it of available process table slots. Note
that this takes a *lot* of zombies.


--
Christopher Mattern

NOTICE
Thank you for noticing this new notice
Your noticing it has been noted
And will be reported to the authorities

Re: ? about using multi-level menu system using dispatch method

am 09.04.2008 21:42:43 von mmccaws2

On Apr 9, 12:10=A0pm, Chris Mattern wrote:
> On 2008-04-09, RedGrittyBrick wrote:
>
>
>
>
> > AFAIK zombies usually consume minimal resources in terms of memory, etc,=

>
> Zombies consume *no* resources. =A0A zombie process is an entry in the
> process table with a return code, nothing more. =A0They consume no
> resources whatsoever other than the process table entry.
>
> > but occupy slots in the process table such that it if they multiply in
> > an unlimited way, the OS may eventually be unable to start any new
> > process due to lack of resources (like process table slots). It is a
> > long time since I first encountered this so the details may differ in
> > current OSs.
>
> This is correct. =A0The only way zombies can actually hurt the system
> is if they actually starve it of available process table slots. =A0Note
> that this takes a *lot* of zombies.
>
> --
> =A0 =A0 =A0 =A0 =A0 =A0 =A0Christopher Mattern
>
> NOTICE
> Thank you for noticing this new notice
> Your noticing it has been noted
> And will be reported to the authorities

both very clear answers. Thanks

I'm on HPUX. I learn from my system admins what they feel is this
system's best way to assess it's memory usage.

Thanks

Mike