Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de453960 authored by Dirk Rettschlag's avatar Dirk Rettschlag
Browse files

Set some GC parameters only for dalvik

Commit https://github.com/CyanogenMod/android_frameworks_base/commit/8f566390bceee9f01b1721c4d00b1b246d26be16


fixed parsing of certain GC values. Before the result was "" and so the
if statement was always false, never executing the setTargetHeap* calls.

Now they are executed but ART currently doesn't support setting
heapminfree and heapconcurrentstart resulting in a UnsatisfiedLinkError
Exception.

Check for the used runtime first and only execute the methods for Dalvik. 

Change-Id: I09e60802685acbec04598646e9f7700f33b53b4c
Signed-off-by: default avatarDirk Rettschlag <dirk.rettschlag@gmail.com>
parent f9732c06
Loading
Loading
Loading
Loading
+16 −11
Original line number Diff line number Diff line
@@ -4198,12 +4198,16 @@ public final class ActivityThread {

        Log.d(TAG, "handleBindApplication:" + data.processName );

        String runtime = VMRuntime.getRuntime().vmLibrary();

        String str  = SystemProperties.get("dalvik.vm.heaptargetutilization", "" );
        if( !str.equals("") ){
            float heapUtil = Float.valueOf(str.trim()).floatValue();
            VMRuntime.getRuntime().setTargetHeapUtilization(heapUtil);
            Log.d(TAG, "setTargetHeapUtilization:" + heapUtil );
        }
        // ART currently doesn't support these methods
        if (runtime.equals("libdvm.so")) {
            String heapMinFree = SystemProperties.get("dalvik.vm.heapminfree", "" );
            int minfree =  parseMemOption(heapMinFree);
            if( minfree > 0){
@@ -4216,6 +4220,7 @@ public final class ActivityThread {
                VMRuntime.getRuntime().setTargetHeapConcurrentStart(concurr_start);
                Log.d(TAG, "setTargetHeapConcurrentStart:" + concurr_start );
            }
        }

        ////
        ////If want to set application specific GC paramters, can use