[EMAIL PROTECTED] wrote:
> This mail is probably naive. Sorry.
>
Not so naive !
>
> I want to set up a cache, storing html templates and perl widgets (held
> in MySQL) that are regularly eval'd. I want to attach timestamps and hit
> counts to each stored scalar, to help decide which are the most
> important values to cach, and allow updates to the cache if values are
> changed. I'm also looking at IPC::Cache.
>
> Now, I only have 128MB RAM. When I'm populating the hash, I can limit
> the size of the cache to available RAM by reading freemem from
> /proc/meminfo, so I don't run into swap space.
>
> However, when I undef a range of hash values, the free memory in
> /proc/meminfo doesn't increase - it seems permanently allocated.
>
As far as I know, kernels are not able to desallocate ( ! ) memory segment,
exept when the allocating process die.
>
> Does anyone have any thoughts on how I can judge whether I have space to
> add a value to a cache, or whether I need to clean out unused vales from
> the cache.
>
You could at server startup store the size of free mem as MEN_FREE of your
system, set the max size of each httpd process at SIZE_PER_MAX_HTTPD ( cf
Apache::SizeLimit ), the maxclient to MAX_CLIENT ( cf your httpd.conf )
Then with the size of CACHED_DATA you should take some decisions.
Hopes it help...
--
Don't be irreplaceable, if you can't be replaced, you can't be promoted.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]