You can make it similar to DB driver where each pool has its own
schedule proc for periodic checks
Ns_ScheduleProc(CheckPool, poolPtr, 0,
Ns_ConfigIntRange(path, "checkinterval", 600, 0,
INT_MAX));
Zoran Vasiljevic wrote:
Hi!
I have observed a ns_cache behaviour that I'd like to change.
In ns_cache, it is possible to create timestamped elements
that would expire after some time. But, they will never
expire on their own. If you fill the cache with thousands
of elements and never visit any of those any more, they will
stay in the cache forever, bloating the memory.
There has to be some instance that will either automatically
purge expired elements (a yet-another-detached thread) or
one should be able to do that programatically, like
ns_cache_flush ?-expired? cache
otherwise the system memory just bloats and bloats.
At the moment, the only workaround to this behaviour
is programmer calling
ns_cache_keys
as it will return all still-valid keys, silently deleting
expired ones. This is not optimal, as again large memory might
be needed to store all the "alive" keys, although caller is
not particulary interested to have them in the first place.
What should we do?
Cheers
Zoran
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/