I added some classes to ns-2 simulator for my project. It would involve several pointers and vectors. During simulation, objects get destroyed before simulation ends. I would appreciate if someone shares me the life time of objects in C++ or how Linux system is handling applications that consume large memory and CPU. My project also involves tcp communications. I will share some part of the code if required.