On Wed, Sep 14, 2011 at 9:59 PM, Pratik Prajapati <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). > > As per my understanding, dalvik creates a single .dex file by combining all > the .class in the apk. Does dalvik breaks this .dex file while running its > bytecode and use the minimum code in memory? >
You can read about dalvik, it's very interesting. There is a good explanation on the design methodology. From my understanding, the idea is that you have a zygote, that can fork and already share that base vm implementation in memory, and have your code mmap()'d in memory to execute. I wouldn't worry about having a big apk too much. I think (this could be a complete lie) that the way to handle this sort of thing is to punt it down to the systems level, which can handle which pieces of your code (mmap()'d) in have to stick around, simply as if you were reading a huge file using mapped memory (i.e., linux already has good support for this, it's not just a dalvik problem). Kris -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en