Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: A (memory) poor man's hash

by hardburn (Abbot)
on Nov 21, 2003 at 18:43 UTC ( #309000=note: print w/ replies, xml ) Need Help??


in reply to Re: A (memory) poor man's hash
in thread A (memory) poor man's <strike>hash</strike> lookup table.

I still find hashes a little daunting.

BrowserUK (if I may presume) was speaking in relative terms. Hashes are quite easy compared to (for example) Perl's advanced data structures, object system, or closures.

While hashes may have a tendancy to soak up a lot of memory, it's not using it for that long.

The problem is that perl usually doesn't free the memory back to the OS until the process exits (though it will reuse that memory for other things). This is particularly a problem for mod_perl, where the process will stick around as long as Apache is up (potentially years, if your sysadmin is neglegent about security patches ;).

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated


Comment on Re: Re: A (memory) poor man's hash
Download Code
Re: Re: Re: A (memory) poor man's hash
by etcshadow (Priest) on Nov 22, 2003 at 03:52 UTC
    MaxRequestsPerChild... or maybe Apache::SizeLimit

    ------------
    :Wq
    Not an editor command: Wq
Re: Re: Re: A (memory) poor man's hash
by liz (Monsignor) on Nov 22, 2003 at 10:29 UTC
    ...(though it will reuse that memory for other things). This is particularly a problem for mod_perl, where the process...

    One approach that I always use when a request is going to be quite resource consuming, is to let the child process die after the request is served. You can do this with $r->child_terminate. The extra CPU for forking a new child process is a lot less than the CPU you would lose when the server starts swapping.

    Liz

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://309000]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2014-12-27 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls