Process memory usage

Can anyone help me figure out how much memory a process is using under QNX Nuetrino 6.3.2? I need to know the total process size (heap, stack, code etc)

I tried to fstat /proc/ as i thought i could get the info from the stat structure but that does not seem to work.

Get the source to pidin and see how it`s done.