1) To check the number of sessions held in memory ( read this article for more detailed analysis on dealing with unclosed sessions ), in windows, get CQ process id
jmap -histo:live <<pid>> | findstr CRXSessionImpl
So in my CQ, as of this writing, there are 105 sessions (second column) still open in memory
2) To generate and check thread dumps, either use Threads tab of CQ5 Web Console http://localhost:4502/system/console or Jstack
Run the jstack command of jvm
jstack <<pid>> | findstr cq