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

Commit fbc95831 authored by Abhimanyu Garg's avatar Abhimanyu Garg
Browse files

Framework/base: Relocating GC calls at the end of loop during zygote init

Relocating explicit GC calls at the end of the loop during the preloading
the resources and preloading clases, with this changes boottime improved.

Change-Id: I2e05ef68578eddca8cd435b5186e198ee7d71739
parent 4ff9ff1e
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -329,7 +329,6 @@ public class ZygoteInit {
                                Log.v(TAG,
                                    " GC at " + Debug.getGlobalAllocSize());
                            }
                            System.gc();
                            runtime.runFinalizationSync();
                            Debug.resetGlobalAllocSize();
                        }
@@ -349,7 +348,7 @@ public class ZygoteInit {
                        throw new RuntimeException(t);
                    }
                }

                System.gc();
                Log.i(TAG, "...preloaded " + count + " classes in "
                        + (SystemClock.uptimeMillis()-startTime) + "ms.");
            } catch (IOException e) {
@@ -421,7 +420,6 @@ public class ZygoteInit {
                if (false) {
                    Log.v(TAG, " GC at " + Debug.getGlobalAllocSize());
                }
                System.gc();
                runtime.runFinalizationSync();
                Debug.resetGlobalAllocSize();
            }
@@ -438,6 +436,7 @@ public class ZygoteInit {
                }
            }
        }
        System.gc();
        return N;
    }

@@ -449,7 +448,6 @@ public class ZygoteInit {
                if (false) {
                    Log.v(TAG, " GC at " + Debug.getGlobalAllocSize());
                }
                System.gc();
                runtime.runFinalizationSync();
                Debug.resetGlobalAllocSize();
            }
@@ -466,6 +464,7 @@ public class ZygoteInit {
                }
            }
        }
        System.gc();
        return N;
    }