On Aug 17, 2006, at 2:54 AM, Leo Lapworth wrote:
Sounds like a totally sensible approach.
I was being slightly flippant with my RAM/CPU is cheep comment
(though for me personally it does have some mileage) and I'm not
saying that
code should be a hack, and of course it must be tested properly.
Ram / CPU is cheap, but to an extent. Once you max your machine
out, it becomes another machine-- which means about a minimum $2400/
year committment ( colo , electricity , bandwidth, hardware , or
dedicated rental ) + dealing with another machine to setup (another 5
minutes every time you have to upgrade ).
Fixing / Tracking stuff like this, for me, is just a lot of long term
savings of time money and aggravation. sure i'll need to cluster out
more eventually and assume those costs, but i won't have to do it as
soon.
FWIW, I've found the following things to be the worst:
eval EXPR
my $x= eval("");
under ab, it grows about 4k per eval per request. that memory
never seems to be reclaimed under mod_perl.
( i haven't profiled eval BLOCK ( eval{} ) yet. i 'm going to
guess there's no issue with it though, as i use it to trap errors
everywhere, and none of my db routines or page generation sections
are growing )
creating a populated anonymous hash ?
the growth i found in Apache::Session ( under ab ) was in
TIEHASH :
my $self = {
args => $args,
data => { _session_id => $session_id },
serialized => undef,
lock => 0,
status => 0,
lock_manager => undef, # These two are object refs ...
object_store => undef,
generate => undef, # but these three are subroutine refs
serialize => undef,
unserialize => undef,
};
that too leaked 4k per request under ab, and never got reclaimed
i put the ? in there , because i'm not sure what is at fault.
as i'm not sure exactly how TIEHASH works with tie. the growth
happens in that anonymous hash creation.
there's no growth if
my $self= {};
i checked to make sure the objects were being destroyed correctly,
and they were. i couldn't find any references to the data or any of
the other vars that would have resulted in those objects not being
expired, but I very well could have missed something.
// Jonathan Vanasco
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -