Re: Scotty mem usage growing

Sveinar Rasmussen (sveinarr@stud.cs.uit.no)
Mon, 28 Jul 1997 14:44:09 +0200 (METDST)

On Fri, 25 Jul 1997, Juergen Schoenwaelder wrote:

>
> Sveinar Rasmussen <sveinarr@stud.cs.uit.no> said:
>
> Sveinar> The memory leak doesn't happen if I comment the
> Sveinar> following lines of my code:
>
> Sveinar> proc setMIB {var val} {
> Sveinar> global s
> Sveinar> $s instance $var $var $val
> Sveinar> }
>
> I can reproduce the problem - so there is a good chance that it will
> be fixed in 2.2.0. Yopu can work around the problem by using the "$s
> instance" command only once to establish the connection between the
> MIB instance and the Tcl variable. Afterwards, you simply update the
> Tcl variable.
>

Thanks for such a quick response. I have been trying several things
lately in order to stop the hungry program (got a 60 MB core today :).
For starters, I've recompiled scotty with a patch from Hans Dekker.
However, that didn't make the problems go away, I'm afraid.

Now, getting back to the idea of "simply updating the Tcl variable".
Does anyone know where scotty stores the Snmp values? I'm trying
to just set the global tcl variable used with "$s instance", but that
unfortunately, didn't work. No variables got an update, but I know
for a fact that the global tcl variable of mine was updated. It's
not reflected in the snmp database:

proc setMIB {var val} {
global s $var
if {[info exists $var]} {
upvar \#0 $var mibvar
set mibvar $val
} else {
set $var $val
$s instance $var $var $val
}
}

As you can see, the global variable is only updated if it already exists.
A new instance is only done when we're dealing with new variables :)
When I run the code above, the memory problem is gone. Scotty
happily lands at 2.1 MB of mem usage which is just fine (compared with
the normal 60 MB :) Life is great!

I also tried the following code from Buz Owen <ado@bbn.com>, but I've
the same results -- no updates reflected to the outside world (snmp
client):

proc setMib {var val} {
global s mibval
if { ! [ info exists mibval($var) ] } {
$s instance $var mibval($var) $val
}
set mibval($var) $val
}
My system configuration (if needed): Platform: HPUX 10.20
Memory: 144 MB phys, 250 MB swap Scotty v: 2.1.6

.. so if I just could find out how to update the Snmp database
without doing a new instance ... What could possibly be wrong here?

--
Warm greetings from a intrigued & hopeful Scotty user,
Sveinar (sveinarr@stud.cs.uit.no)
--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.