Some situations are fairly adversarial to Scudo, notably when there is a lot of allocations in a small class size followed by deallocations. Since we do not release those except on forced-release, we end up with a higher RSS that's not going away.
Since releasing smaller classes is expensive, I tried to find the most balanced way to proceed.
The point of this change is to force-release classes when the % of freed chunks in a class size is very high (in the 9x% area), and if the number of blocks pushed in the freelist since last release is also high (I set that to 25%).
A very small size class (16 bytes) won't release significant memory unless it's mostly empty (98-99%) due to randomization.
There is a small drawback when an application does an M_PURGE shortly after a burst a deallocation, then we end up going through the release code twice as we still want to fulfill the release request.