dalvik.system
public
final
class
dalvik.system.VMRuntime
Provides an interface to VM-global, Dalvik-specific features.
An application cannot create its own Runtime instance, and must obtain
one from the getRuntime method.
Summary
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Methods
public
void
gcSoftReferences()
Requests that the virtual machine collect available memory,
and collects any SoftReferences that are not strongly-reachable.
public
long
getExternalBytesAllocated()
Returns the number of externally-allocated bytes being tracked by
trackExternalAllocation/Free().
public
long
getMinimumHeapSize()
Returns the minimum heap size, or zero if no minimum is in effect.
Returns
- the minimum heap size value
public
static
VMRuntime
getRuntime()
Returns the object that represents the VM instance's Dalvik-specific
runtime environment.
public
float
getTargetHeapUtilization()
Gets the current ideal heap utilization, represented as a number
between zero and one. After a GC happens, the Dalvik heap may
be resized so that (size of live objects) / (size of heap) is
equal to this number.
Returns
- the current ideal heap utilization
public
void
runFinalizationSync()
Does not return until any pending finalizers have been called.
This may or may not happen in the context of the calling thread.
No exceptions will escape.
public
synchronized
long
setMinimumHeapSize(long size)
Sets the desired minimum heap size, and returns the
old minimum size. If size is larger than the maximum
size, the maximum size will be used. If size is zero
or negative, the minimum size constraint will be removed.
Synchronized to make the order of the exchange reliable.
Parameters
size
| the new suggested minimum heap size, in bytes |
Returns
- the old minimum heap size value
public
float
setTargetHeapUtilization(float newTarget)
Sets the current ideal heap utilization, represented as a number
between zero and one. After a GC happens, the Dalvik heap may
be resized so that (size of live objects) / (size of heap) is
equal to this number.
Parameters
newTarget
| the new suggested ideal heap utilization.
This value may be adjusted internally. |
Returns
- the previous ideal heap utilization