Implemented measuring of memory of subprocesses in separate thread.