As a latecomer on OpenACS, ...
well, you are a member of OpenACS since 12 years.
are you asking for curiosity, or do you suspect an issue with this?
db_release_unused_handles calls "ns_db release handle", which returns a given handle allocated by a connection thread to the pool of db-handles (db connections) managed by NaviServer/AOLserver (the code for these servers is different). More precise, this is called in the cleanup traces, where also global variables are deleted, etc.
But notice, one might have as well long-running requests, maybe threads running in the background, or running in separate threads, where db-handles are allocated in a certain situation, but normally not used. These can become an issue, since the typical recommendation for db-handles is based on potential current connection threads, without considering background threads. Also notice, that the there are as well other mechanisms in place to clean up handles based on usage count or usage timeouts.
db-connections are expensive, since these require (at least in the case of PostgreSQL) separate processes with their own caching management. So on machines with very constraint resources, these can make the difference (thinking also on embedded applications and IoT). The goal is to use as few as possible db-handle without the need to wait for it when these are needed.
Answering unasked questions:
* Do I have to care as an OpenACS user about the handling of DB connections? Not really.
* Can intentional releasing of db-handle be important for certain applications? Probably.
* Should I add db_release_unused_handles calls to my self-developed OpenACS applications? No, usually the framework handles this sufficiently.
* Can I remove all ns_db_release_unused_handles in the OpenACS core packages? I would not recommend this (unless there is a real need)
I see many calls to "db_release_unused_handles" in the www directory of application packages, such as "survey" or "evaluation". Without looking into the details, i would suggest that these calls are not necessary and can be removed.