How does method GetMemoryUsage() calculate the values inside the JVM of bwengine
book
Article ID: KB0082726
calendar_today
Updated On:
Description
GetMemoryUsage() is provided by BW microagent, how are the values of TotalBytes, FreeBytes, UsedBytes and PercentUsed determined? What are their units of measurement and what do they mean?
Issue/Introduction
How does method GetMemoryUsage() calculate the values inside the JVM of bwengine
Resolution
In case of GetMemoryUsage() of bwengine,GetMemoryUsage() returns four values: TotalBytes,FreeBytes,UsedBytes and PercentUsed.
TotalBytes -Total number of bytes allocated to the process engine.
FreeBytes - Total number of bytes that are not currently in use.
UsedBytes - Total number of bytes that are currently in use.
PercentUsed - Percentage of total bytes that are in use.
GetMemoryUsage() is used to determine how much memory is actually used by the JVM. The BusinessWorks (BW) engine is internally a Java Virtual Machine. It uses memory as given by Process(), but inside JVM it also tracks how much of stack space is used and how much is not. GetMemoryUsage tracks the inter-usage of memory of the JVM rather thatn the operation system memory usage.
The following methods are used to get the memory used by the JVM:
TotalBytes = java.lang.Runtime.getRuntime().totalMemory()
FreeBytes = java.lang.Runtime.getRuntime().freeMemory()
UsedBytes = TotalBytes - FreeBytes
PercetUsed = UsedBytes/TotalBytes
The unit of measure returned by the BW Engine getMemoryUsage() is in bytes.
Additional Information
http://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html
Feedback
thumb_up
Yes
thumb_down
No