I have this issue with some legacy code (c++). Initially the whole code was designed to be utilized as a stand alone tool. That being said there is an entire network of implicit object destructors that free up memory when code executes. Now the legacy code has a slightly different utility, it is being called repeatedly and objects are not being destructed. Rewriting the whole thing would be a challenge (especially because the original author is not with us any more, code has not comments (i guess people before did not comment a lot - it was obvious ) and noone really is interested in redoing it) is there a way to extract a function call into a separate process with a separate pid which when executes, completely dies calling all implicit destructors for all objects in the process? Any examples ?