Codemesh Runtime v3 C++ API Reference
3.9.205
|
A utility class that exposes some system/runtime functions to C++. More...
#include <xmog_java_lang_System.h>
Static Public Member Functions | |
static char * | getProperty (const char *name, xmog_localenv *env=NULL) |
Returns the value of the given property or NULL if it does not exist. More... | |
static void | setProperty (const char *name, const char *value, xmog_localenv *env=NULL) |
Sets the value of the given property. More... | |
static void | gc (xmog_localenv *env=NULL) |
Asks the Java garbage collector to run. More... | |
static jlong | totalMemory (xmog_localenv *env=NULL) |
Returns the total amount of memory in the JVM. More... | |
static jlong | freeMemory (xmog_localenv *env=NULL) |
Returns the amount of free memory in the JVM. More... | |
static jlong | maxMemory (xmog_localenv *env=NULL) |
Returns the maximal amount of memory that the JVM will attempt to use. More... | |
static jint | availableProcessors (xmog_localenv *env=NULL) |
Returns the number of processors on the system. More... | |
A utility class that exposes some system/runtime functions to C++.
This class is useful when we need a convenient way to check or modify system properties at runtime, for example in a configuration hook that adds system properties immediately after the JVM has been loaded.
It is also useful when you need to query the grbage collector for stats on available heap, etc.
|
static |
Returns the number of processors on the system.
This function is only available in JREs since version 1.4. If called in an earlier JVM, the return value is undefined (but most likely 1).
env | an optional local call environment. Defaults to NULL . |
|
static |
Returns the amount of free memory in the JVM.
env | an optional local call environment. Defaults to NULL . |
|
static |
Asks the Java garbage collector to run.
env | an optional local call environment. Defaults to NULL . |
|
static |
Returns the value of the given property or NULL
if it does not exist.
name | the property name. |
env | an optional local call environment. Defaults to NULL . |
NULL
. The caller is responsible for freeing the returned string with a call to xmog_java_string::free() or xmog_util::free().
|
static |
Returns the maximal amount of memory that the JVM will attempt to use.
This function is only available in JREs since version 1.4.
env | an optional local call environment. Defaults to NULL . |
|
static |
Sets the value of the given property.
name | the property name. |
value | the property value. |
env | an optional local call environment. Defaults to NULL . |
|
static |
Returns the total amount of memory in the JVM.
env | an optional local call environment. Defaults to NULL . |