View Java Process Health
Jps-lvm
View Java default heap size
java-xx:+printflagsfinal | grep maxheapsize
Eclipse Debug Settings VM parameters
Right-click on the project, then "Debug as", then "Debug Configurations", in the arguments parameter "VM arguments:" Fill in the following values.
View VM Parameters
Public class testmemory {
/**
* @param args
*/
Public Static void Main (string[] args) {
System. out. println ("Memory Information:" + Tomemoryinfo());
}
/**
* Gets the memory information of the current JVM
*
* @return
*/
Public Static String Tomemoryinfo () {
Runtime currruntime = runtime. GetRuntime ();
int nfreememory = ( int ) (currruntime.freememory ()/1024/1024);
int ntotalmemory = ( int ) (currruntime.totalmemory ()/1024/1024);
return nfreememory + "m/" + ntotalmemory + "M (free/total)";
}
}
Summary of Java tuning knowledge