Skip to contents

Collects JVM statistics such as the number of JAR files loaded, Java version, PHG version, and memory usage. Returns an instance of the JvmStats class populated with these statistics.

Usage

jvmStats()

Value

An object of class JvmStats, containing the following fields:

  • nJars: The number of JAR files in the JVM classpath.

  • javaVersion: The version of Java being used.

  • phgVersion: The version of PHG (Practical Haplotype Graph) being used.

  • maxMem: The maximum memory (in GB) that the JVM can use.

  • totMem: The total memory (in GB) allocated to the JVM.

  • freeMem: The amount of free memory (in GB) in the JVM.

  • allocMem: The amount of allocated memory (in GB) in the JVM.

Details

This function requires that the JVM is initialized. If the JVM is not initialized, it will throw an error. Use the initPhg() function to initialize the JVM with the PHG library path before calling this function.

The function retrieves the number of JAR files in the classpath, the version of Java and PHG being used, and memory statistics including maximum memory, total memory, free memory, and allocated memory (all in gigabytes).

See also

Examples

if (FALSE) { # \dontrun{
# Ensure that the JVM is initialized with PHGv2 library path
initPhg("/path/to/phgv2")

# Collect JVM statistics
stats <- jvmStats()
show(stats)
} # }