public final class VMRuntime extends Object
| Modifier and Type | Method and Description |
|---|---|
long |
addressOf(Object array)
Returns the address of array[0].
|
String |
bootClassPath()
Returns the VM's boot class path.
|
void |
clampGrowthLimit()
Make the current growth limit the new non growth limit capacity by releasing pages which
are after the growth limit but before the non growth limit capacity.
|
String |
classPath()
Returns the VM's class path.
|
void |
clearGrowthLimit()
Removes any growth limits, allowing the application to allocate
up to the maximum heap size.
|
void |
concurrentGC() |
void |
disableJitCompilation()
Tells the VM to disable the JIT compiler.
|
void |
gcSoftReferences()
Deprecated.
|
static String |
getCurrentInstructionSet()
Returns the instruction set of the current runtime.
|
long |
getExternalBytesAllocated()
Deprecated.
|
static String |
getInstructionSet(String abi)
Returns the runtime instruction set corresponding to a given ABI.
|
long |
getMinimumHeapSize()
Deprecated.
|
static VMRuntime |
getRuntime()
Returns the object that represents the VM instance's Dalvik-specific
runtime environment.
|
float |
getTargetHeapUtilization()
Gets the current ideal heap utilization, represented as a number
between zero and one.
|
int |
getTargetSdkVersion()
Gets the target SDK version.
|
boolean |
is64Bit()
Returns whether the VM is running in 64-bit mode.
|
static boolean |
is64BitAbi(String abi) |
static boolean |
is64BitInstructionSet(String instructionSet) |
static boolean |
isBootClassPathOnDisk(String instructionSet)
Return false if the boot class path for the given instruction
set mapped from disk storage, versus being interpretted from
dirty pages in memory.
|
boolean |
isCheckJniEnabled()
Returns whether the VM is running with JNI checking enabled.
|
boolean |
isDebuggerActive()
Returns true if either a Java debugger or native debugger is active.
|
Object |
newNonMovableArray(Class<?> componentType,
int length)
Returns an array allocated in an area of the Java heap where it will never be moved.
|
Object |
newUnpaddedArray(Class<?> componentType,
int minLength)
Returns an array of at least minLength, but potentially larger.
|
void |
preloadDexCaches()
Fill in dex caches with classes, fields, and methods that are
already loaded.
|
String[] |
properties()
Returns a copy of the VM's command-line property settings.
|
static void |
registerAppInfo(String appDir,
String processName,
String pkgname)
Register application info
|
void |
registerNativeAllocation(int bytes)
Registers a native allocation so that the heap knows about it and performs GC as required.
|
void |
registerNativeFree(int bytes)
Registers a native free by reducing the number of native bytes accounted for.
|
void |
requestConcurrentGC() |
void |
requestHeapTrim() |
static void |
runFinalization(long timeout)
Wait for objects to be finalized.
|
void |
runFinalizationSync()
Deprecated.
|
void |
runHeapTasks() |
long |
setMinimumHeapSize(long size)
Deprecated.
|
float |
setTargetHeapUtilization(float newTarget)
Sets the current ideal heap utilization, represented as a number
between zero and one.
|
void |
setTargetSdkVersion(int targetSdkVersion)
Sets the target SDK version.
|
void |
startHeapTaskProcessor() |
void |
startJitCompilation()
Tells the VM to enable the JIT compiler.
|
void |
stopHeapTaskProcessor() |
boolean |
trackExternalAllocation(long size)
Deprecated.
|
void |
trackExternalFree(long size)
Deprecated.
|
void |
trimHeap() |
void |
updateProcessState(int state)
Let the heap know of the new process state.
|
String |
vmInstructionSet()
Returns the VM's instruction set.
|
String |
vmLibrary()
Returns the name of the shared library providing the VM implementation.
|
String |
vmVersion()
Returns the VM's version.
|
public static VMRuntime getRuntime()
public String[] properties()
public String bootClassPath()
public String classPath()
public String vmVersion()
public String vmLibrary()
public String vmInstructionSet()
public boolean is64Bit()
public boolean isCheckJniEnabled()
public float getTargetHeapUtilization()
public float setTargetHeapUtilization(float newTarget)
This is only a hint to the garbage collector and may be ignored.
newTarget - the new suggested ideal heap utilization.
This value may be adjusted internally.IllegalArgumentException - if newTarget is <= 0.0 or >= 1.0public void setTargetSdkVersion(int targetSdkVersion)
public int getTargetSdkVersion()
setTargetSdkVersion(int) for
special values.@Deprecated public long getMinimumHeapSize()
@Deprecated public long setMinimumHeapSize(long size)
@Deprecated public void gcSoftReferences()
@Deprecated public void runFinalizationSync()
System.runFinalization().@Deprecated public boolean trackExternalAllocation(long size)
@Deprecated public void trackExternalFree(long size)
@Deprecated public long getExternalBytesAllocated()
public void startJitCompilation()
public void disableJitCompilation()
public Object newNonMovableArray(Class<?> componentType, int length)
public Object newUnpaddedArray(Class<?> componentType, int minLength)
public long addressOf(Object array)
public void clearGrowthLimit()
public void clampGrowthLimit()
public boolean isDebuggerActive()
public void registerNativeAllocation(int bytes)
public void registerNativeFree(int bytes)
public static void runFinalization(long timeout)
timeout - timeout in nanoseconds of the maximum time to wait until all pending finalizers
are run. If timeout is 0, then there is no timeout. Note that the timeout does
not stop the finalization process, it merely stops the wait.#Runtime.runFinalization(),
Object.wait(long,int)public void requestConcurrentGC()
public void concurrentGC()
public void requestHeapTrim()
public void trimHeap()
public void startHeapTaskProcessor()
public void stopHeapTaskProcessor()
public void runHeapTasks()
public void updateProcessState(int state)
public void preloadDexCaches()
public static void registerAppInfo(String appDir, String processName, String pkgname)
public static String getInstructionSet(String abi)
armeabi-v7a and armeabi might map to the instruction set arm.
This influences the compilation of the applications classes.public static boolean is64BitInstructionSet(String instructionSet)
public static boolean is64BitAbi(String abi)
public static boolean isBootClassPathOnDisk(String instructionSet)
public static String getCurrentInstructionSet()