Checking heap memory size for java app

Hi

I have one Java application installed in my Solaris system. Is there a way to find out the heap memory allocated size/used size/free size for the particular Java process?

If anyone knows the command, please let me know. Even I appreciate if I have any scripts to find out the same.

Regards,
Thiru