• Post Reply Bookmark Topic Watch Topic
  • New Topic

How much momery I used?  RSS feed

 
Ruigao Tang
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi~
guys.
How could I get the max memory used when running a desktop java programm?
It seems maxMemory()- freeMemory()(methods of java.lang.Runtime) can get it,but the result is 58MB.

It's a simple console program, could it be so much?
Is it the memory include the used memory of JVM?
How could I get the memory of my program itself used except JVM?

Thank you! and forgive my poor English
 
Joe Ess
Bartender
Posts: 9439
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the JVM displaces a lot of memory just starting up.
JConsole can give you a better idea as to how much memory your application uses.
 
Ruigao Tang
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,Joe.
It's a good idea, and need some time to learn...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!