I think you meant you want to use jmap (not jstack). Here is an example that I like to use:
[rhusar@rhusar as-master]$ jps -l
18374 org.jetbrains.idea.maven.server.RemoteMavenServer
18281 com.intellij.idea.Main
21105 sun.tools.jps.Jps
[rhusar@rhusar as-master]$ jmap -histo:live 18281 | head
num #instances #bytes class name
----------------------------------------------
1: 176916 24493688 <constMethodKlass>
2: 176916 24077408 <methodKlass>
3: 22170 23879160 <constantPoolKlass>
4: 22170 18736416 <instanceKlassKlass>
5: 139987 13574248 [C
6: 198198 12992576 [B
7: 18624 12898400 <constantPoolCacheKlass>