It would not be safe to clean just everything there, on the fly. Alive processes may have expected some data in there.

The best way to solve it, to keep it cleaned well. You should try to figure out which globals have a bigger size. And if it's are part of your app, you may try to figure out which one could be cleaned safely and at what time. 

Unfortunately, there is no simple way of any debug for any web requests. And it does not really matter in docker or not.