is there a way to find out the heap memory size?

I'm creating an application that dynamically creates objects, and i need to find out if the created objects are destroyed when a certain condition is met. And one way to find out if the objects are destroyed is by finding out the heap memory size, before the object is created and the size after it was destroyed.

Is there any way to do this?

Thank you very much.