diff options
author | Wei Wang <wangw@codeaurora.org> | 2013-01-23 15:19:11 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2013-02-22 09:53:36 -0800 |
commit | 27196ebc8d8d0cd8279755b6eca587f2f8ac6d4b (patch) | |
tree | 38b0b7df0f4b4f5e759c98a56913cc206969a28c | |
parent | 6e80bc616a001bad0df9a1822880db0855133ad4 (diff) | |
download | libcore-27196ebc8d8d0cd8279755b6eca587f2f8ac6d4b.zip libcore-27196ebc8d8d0cd8279755b6eca587f2f8ac6d4b.tar.gz libcore-27196ebc8d8d0cd8279755b6eca587f2f8ac6d4b.tar.bz2 |
GC triggering performance optimizations
Copy the correct starting heap size at process init.
Interfaces to set GC/managed heap parameters.
Change-Id: If0b1637291e77f9781ae6249c5d0257f659253ca
-rw-r--r-- | dalvik/src/main/java/dalvik/system/VMRuntime.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dalvik/src/main/java/dalvik/system/VMRuntime.java b/dalvik/src/main/java/dalvik/system/VMRuntime.java index 71098be..239a876 100644 --- a/dalvik/src/main/java/dalvik/system/VMRuntime.java +++ b/dalvik/src/main/java/dalvik/system/VMRuntime.java @@ -107,6 +107,31 @@ public final class VMRuntime { } /** + * @hide + */ + public float setTargetHeapMinFree(int size) { + /* Synchronize to make sure that only one thread gets + * a given "old" value if both update at the same time. + * Allows for reliable save-and-restore semantics. + */ + synchronized (this) { + return nativeSetTargetHeapMinFree(size); + } + } + /** + * @hide + */ + public float setTargetHeapConcurrentStart(int size) { + /* Synchronize to make sure that only one thread gets + * a given "old" value if both update at the same time. + * Allows for reliable save-and-restore semantics. + */ + synchronized (this) { + return nativeSetTargetHeapConcurrentStart(size); + } + } + + /** * Sets the target SDK version. Should only be called before the * app starts to run, because it may change the VM's behavior in * dangerous ways. Use 0 to mean "current" (since callers won't @@ -156,6 +181,12 @@ public final class VMRuntime { * This value may be adjusted internally. */ private native void nativeSetTargetHeapUtilization(float newTarget); + /* @hide + */ + private native int nativeSetTargetHeapMinFree(int size); + /* @hide + */ + private native int nativeSetTargetHeapConcurrentStart(int size); /** * This method exists for binary compatibility. It was part of |