This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reporting memory usage  RSS feed

 
Richard Robbins
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a test application that needs to report how much memory is being used by the JVM. Does anyone know how to access this information at runtime?
 
Junaid Bhatra
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Runtime.getRuntime().totalMemory(); returns the total amount of memory in the JVM. Check the api for more details.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!