Check memory leak

I am running c++ code on AIX unix.I have a doubt that my code is using some memory but it is not clearing that.Some time i am getting heap allocation problem.In my code i am not using any malloc,new functions also i am justing using pointers and arrays.

Is there any way i can find out if the memory block is filled and it is released for a particular user.

Please help me the way to find the solution for this.

Thanks

prstat -p pidofyourCprogram interval > checkmem.log &
tail -f checkmem.log

It seems we dont have prstat on AIX Unix.

I am getting the following error when i run prstat

ksh: prstat: not found

Thanks