• Post Reply Bookmark Topic Watch Topic
  • New Topic

How To get Heap Memory Used  RSS feed

 
Tanzy Akhtar
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using JMX way to get heap memory.
Used the following code to--



It's working fine as of now.

But i need to get the value of heapmemory used.
Anybody suugest how to achieve it?
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tanzy,

The object returned is a MemoryMXBean, so cast to it and use its methods.

Cheers
Karthik
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!