in reply to Memory leaks

$ref->{PID} = $pid; $ref->{PPID} = $info->{pp_ppid};
Do you mean something more like: $ref->{$pid} = $info->{pp_ppid}; That won't solve your problem. I just don't understand how you get anything other than 2 keys with this code. (Of course, this probably happenned in your cut and paste and works perfectly well in the running program.)

p

Replies are listed 'Best First'.
Re: Re: Memory leaks
by mikfire (Deacon) on Feb 06, 2001 at 20:03 UTC
    I only need the two bits of information - the PID and the parent PID ( ie, PPID ). If you look at the portion where the comment mentions something about "cement shoes and overcoats", you will notice I am sorting by the PPID in a vain attempt to kill the main process.

    mikfire

      Fine, that's a good q&d thing to do and your code probably does it. The code you posted just got mangled so there is no key between $proc{} and {PPID}.
      $total = kill 9, sort { $procs{$a}{PPID} <=> $procs{$b}{PPID} } k +eys %procs; /\ /\
      that's all I was mentioning.

      p