For those interested (to extend it maybe, have the figures in an array
and then have some shiny graphics :p), check attachement.
Op wo, 19-04-2006 te 15:33 -0400, schreef Youness Alaoui:
> On Wed, 19 Apr 2006 15:09:24 -0400, Boris Faure (aka billiob)
> <[EMAIL PROTECTED]> wrote:
>
> > About the http memleak, if you're using pop3 and gmail account, please
> > update it (i've fixed it a few days ago).
> >
>
> nope, not using any plugins apart from : nudge/cam shooter
>
>
> > Maybe we can use the profiler from tcllib (but i don't know how it works)
> >
>
> really easy to use, just read the man page
>
> >> From a previous message from Youness :
> > set fd [open log w]; foreach var [info globals] {global $var; puts $fd
> > "$var : " ; catch {puts $fd "[string length [set $var]]\n"} ; catch
> > { puts
> > $fd "[string length [array get $var]]\n"} }; close $fd
> >
> > set fd [open log w]; foreach namespace [namespace children ::] {foreach
> > var [info vars "${namespace}::*"] {puts $fd "$var : " ; catch {puts $fd
> > "[string length [set $var]]\n"} ; catch { puts $fd "[string length [array
> > get $var]]\n"} } }; close $fd
> >
>
> yeah, something like that.. could be improved probably... instead of
> catch, could be if array exists..
> and we could do :
> set length [string lenght ...]
> lappend memleaks($length) $var
> ...
> # at the end
> foreach size [lsort [array names memleaks]] {
> puts "memory used : $size by variables : [set memleaks($size)]"
> }
>
> or similar.. many many improvements to the code can be done to make it
> look for all memleaks.. procs, commands, vars, arrays, images, etc..
>
>
>
> >
> > --
> > Boris FAURE (aka billiob)
> > mail, msn : [EMAIL PROTECTED]
> > No trees were killed in the sending of this message.
> > However, a large number of electrons were terribly
> > agitated.
> >
> >
> > -------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job
> > easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> > Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
> > _______________________________________________
> > Amsn-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/amsn-devel
>
>
>
proc WriteMemleaks {} {
set fd [open /home/scapor/memleaks.log w]
#Global vars
puts $fd "Global vars:\n"
foreach var [info globals] {
global $var
puts $fd "$var : "
if {[array exists $var]} {
puts $fd "[string length [array get $var]]\n"
} else {
catch {puts $fd "[string length [set $var]]\n"}
}
}
#Objects
puts $fd "Objects (or seems like):\n\t"
foreach namespace [namespace children ::] {
catch { set obs [namespace eval $namespace {info commands \[A-Z\]*\[0-9\]}] }
puts $fd $obs
puts $fd "\n"
}
#Vars
puts $fd "Vars:\n"
foreach namespace [namespace children ::] {
foreach var [info vars ${namespace}::*] {
puts $fd "$var : "
if {[array exists $var]} {
puts $fd "[string length [array get $var]]\n"
} else {
catch {puts $fd "[string length [set $var]]\n"}
}
}
}
close $fd
}