Added methods release_memory() and purge_memory() to object_pool. This complete and fixes #6610, as the remaining part of this ticket was addressed by #3789.