Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MemoryMXBean reads the JVM or CPU memory?

 
Sara Brown
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



May i know is this code will read the memory usage for the JVM or the CPU memory? If its not read the CPU memory, is there any codes or plugin or perhaps some software that can capture the CPU memory while running the program? im using eclipse.

(Next question is related to thread but i guess it still can fit with the general scope.)
Supoose the totalMemoryUsed should be higher or lower when using more threads?
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sara Brown wrote:May i know is this code will read the memory usage for the JVM or the CPU memory?

The MemoryMXBean API clearly states that it manages JVM memory.
The management interface for the memory system of the Java virtual machine.
 
Sara Brown
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if that is the case, then how can i measure or get the physical memory means the cpu memory?
 
varun Dosapati
Ranch Hand
Posts: 31
Java Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sara

found a link http://www.coderanch.com/t/376720/java/java/physical-memory which might helps you.

 
Sara Brown
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
varun Dosapati,

Thank you. I will try it right a way. Thanks for the link.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic