Actually have a look at frameworks/base/preloaded-classes. That file is opened by Zygote and all classes (>1,800) in it are loaded (grep for PRELOAD_CLASSES and preloadClasses() in ZygoteInit.java).
-- Karim Yaghmour CEO - Opersys inc. / www.opersys.com http://twitter.com/karimyaghmour On 11-09-16 01:57 AM, William W.-Y. Liang wrote:
I think Tim meant the 'core' class library, which is pre-loaded into memory for the purposes that Tim has mentioned. You can check the file frameworks/base/core/java/com/android/internal/os/ZygoteInit.java. William Liang 2011/9/16 Pratik Prajapati <pratik.prajap...@gmail.com <mailto:pratik.prajap...@gmail.com>> On Thu, Sep 15, 2011 at 10:16 AM, Tim Bird <tim.b...@am.sony.com <mailto:tim.b...@am.sony.com>> wrote: On 09/14/2011 07:13 PM, Matt Y. wrote: > > > On Thu, Sep 15, 2011 at 9:59 AM, Pratik Prajapati > <pratik.prajap...@gmail.com <mailto:pratik.prajap...@gmail.com> <mailto:pratik.prajap...@gmail.com <mailto:pratik.prajap...@gmail.com>>> wrote: > > Dear All, > > There are a lot of classes in my (big) APK which are used no > where(some test code is part of the APK with the actual service). > Will dalvik VM keep these classes in memory at runtime? ( many > classes are not used to create any object out of them). > > > only when classes are used, dvm loads these classes into memory. If only this were true. Unfortunately, a large number of classes (over 1800) are preloaded by zygote at startup time, to share memory between android processes, and to reduce subsequent application startup time. I'm not familiar with the DEX-combining mentioned, but I do know for sure that a large number of (potentially unused) classes are lying around in memory most of the time. (At least, in Android 2.3) -- Tim You mean to say, even if no objects are created and still classes occupy memory? Please let me know how you have checked it. -- Pratik ============================= Tim Bird Architecture Group Chair, CE Workgroup of the Linux Foundation Senior Staff Engineer, Sony Network Entertainment ============================= -- unsubscribe: android-kernel+unsubscr...@googlegroups.com <mailto:android-kernel%2bunsubscr...@googlegroups.com> website: http://groups.google.com/group/android-kernel -- Regards, Pratik Prajapati Cell: +1-949-351-8370 <tel:%2B1-949-351-8370> -- unsubscribe: android-kernel+unsubscr...@googlegroups.com <mailto:android-kernel%2bunsubscr...@googlegroups.com> website: http://groups.google.com/group/android-kernel -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
-- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel