Hi Dan and all, The code of the project (VAdmind) can be found at: http://ciberlinux.net/proyectos/vadmind/vadmind/ Of particular interest are the files/directories: vadmind.pl - Executable script VAdmind.pm - Main module VAdmind/Plugins/* - Several testing purpose plugins This application does work either on inet (xinetd) or daemon (standalone SSL server) mode. My concern was the following: 1.- While running on inet mode after every client/server transaction the application will stop, but 2.- While on daemon mode, all the transactions which requries to execute more Plugins by the server will increase the memory footprint (or any other resources). The overall comments from yesterday leads to not being able to return freed resources back to the OS once the Plugins have been executed. I hope you can have a look to the code and help me to find if there is a way to solve this. Btw, what tools do you recommend to do some benchmarking/profiling? Regards, -Urivan Flores Saaib ==============Original message text=============== On Tue, 10 Apr 2007 18:17:34 +0100 Daniel Risse wrote: Hello, This is to follow up to what Urivan was discussing last night. I looked and Symbol does in fact define the delete_package() function. There is a warning in the documentation regarding it though: > Symbol::delete_package is a bit too powerful. It undefines every > symbol that > lives in the specified package. Since perl, for performance reasons, > does not > perform a symbol table lookup each time a function is called or a global > variable is accessed, some code that has already been loaded and that > makes use > of symbols in package Foo may stop working after you delete Foo, even if > you reload the Foo module afterwards. There is also something that strikes me as a bit wrong about loading an additional module to assist unloading other modules. The function could be copied and modified to also clear out the %INC entry for the module. > sub delete_package ($) { > my $pkg = shift; > > # expand to full symbol table name if needed > > unless ($pkg =~ /^main::.*::$/) { > $pkg = "main$pkg" if $pkg =~ /^::/; > $pkg = "main::$pkg" unless $pkg =~ /^main::/; > $pkg .= '::' unless $pkg =~ /::$/; > } > > my($stem, $leaf) = $pkg =~ m/(.*::)(\w+::)$/; > my $stem_symtab = *{$stem}{HASH}; > return unless defined $stem_symtab and exists $stem_symtab->{$leaf}; > > > # free all the symbols in the package > > my $leaf_symtab = *{$stem_symtab->{$leaf}}{HASH}; > foreach my $name (keys %$leaf_symtab) { > undef *{$pkg . $name}; > } > > # delete the symbol table > > %$leaf_symtab = (); > delete $stem_symtab->{$leaf}; > } Dan _______________________________________________ San-Diego-pm mailing list San-Diego-pm@pm.org http://mail.pm.org/mailman/listinfo/san-diego-pm ===========End of original message text===========