MDL-31072: Fixed bug causing memory overflow for many-user systems: