Java Total/Free/Used MemoryΒΆ

Note

You can find these scripts inside the folder pmis/STND_PMIS/test/console/example.
If you want to execute them, you can use the Jython Console from the devtool menu.

filename => ex19.py

from java.lang import Runtime

rt = Runtime.getRuntime();
rt.gc();

total = rt.totalMemory()
free = rt.freeMemory()
used = total - free;

print String.format("Total memory: %s", total )
print String.format("Free memory: %s", free )
print String.format("Used memory: %s", used )