Dynamic cache

Report bugs or suggestions around FancyCache
Post Reply
horizon
Level 5
Level 5
Posts: 49
Joined: Wed Jun 03, 2009 9:05 am

Dynamic cache

Post by horizon »

Hi,
Not sure if (/how easily) this is doable but it would be nice to be able to size L1 cache dynamically. (Especially because I don't know not sure how expensive is the opertion of (de)allocating an extra memory.)
This is interesting especially in terms of cache growing (and potentially avoiding DeferredUrgent Writes) rather pushing the cache size down...

There could be followign parameters:
1. Maximum cache= This the highest amount of memory usable as cache.
2. Reserved (soft)= If there is less than XX MB ram free do not grow the cache. (So applications that demand ram will not be rejected.)
3. Reserved (hard)= If there is less than XX MB free, immeditaly start to decrease the cache size. (The other applications are obviously demanding more memory!)
4. Minimum cache= Never decrease the cache below this level.

Depending on the price of memory (de)allocation (this is something what will be probably known to developer) there might be a tendency to
A. keep the cache as big as possible and stick with maximum and easily deallocate memory when needed... If (de)allocation is very cheap operation OR
B. automatically continuosly decrease the cache size and try to stick with minimum... If (de)allocation is expensive.

In my case it would be like this:
Maximum= 1024MB (or unlimited)
Reserved (soft)= 250MB
Reserved (hard)= 200MB
Minimum= 512MB

Anyone else would have the usage for this?

--Lukas
Post Reply