Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Info on Current JVM Memory usage  RSS feed

 
l tilokchandani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need the info on current memory usage of the JVM. And pointers in this regards would be helpful
Regards
lpt
 
Henrik Engert
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the object Runtime to get this information.

- freeMemory()
Returns the amount of free memory in the Java Virtual Machine
- maxMemory()
Returns the maximum amount of memory that the Java virtual machine will attempt to use.
- totalMemory()
Returns the total amount of memory in the Java virtual machine

Example:

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!