Re: [android-developers] help on dalvik VM.
On 15 September 2011 12:35, Praveen PB wrote: > Dvm do not occupy data memory for un used class. What about program memory ? Not sure what you mean here. From what I know, ARM like most modern processors implement Von Neumann architecture, where program and data share the memory. I suspect that you mean Flash memory that serves as as storage in mobile phones. In such case any useless stuff within your application will eat into your available storage left. -- Daniel Drozdzewski -- 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
Re: [android-developers] help on dalvik VM.
Dvm do not occupy data memory for un used class. What about program memory ? On Sep 15, 2011 1:50 PM, "Daniel Drozdzewski" wrote: > On 15 September 2011 02:59, Pratik Prajapati 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? > > > Correct. Class that is not referenced anywhere in your code will never > come into attention of any class loader, hence will never occupy the > memory. > > Please mind that big APK might cause your users pain. It is good > practice to strip debug and test code from the public release. > > Using ProGuard would shave unused classes off. > > -- > Daniel Drozdzewski > > -- > 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 -- 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
Re: [android-developers] help on dalvik VM.
On 15 September 2011 02:59, Pratik Prajapati 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? Correct. Class that is not referenced anywhere in your code will never come into attention of any class loader, hence will never occupy the memory. Please mind that big APK might cause your users pain. It is good practice to strip debug and test code from the public release. Using ProGuard would shave unused classes off. -- Daniel Drozdzewski -- 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
Re: [android-developers] help on dalvik VM.
Should have mentioned, there is a good explanation of the design methodologies from an early talk on Google IO (by the creator, who also has quite a few interesting things to say from a systems perspective). You can find it on youtube, google "dalvik" and it will probably be the first thing popping up. Kris On Thu, Sep 15, 2011 at 2:11 AM, Kristopher Micinski wrote: > On Wed, Sep 14, 2011 at 9:59 PM, Pratik Prajapati > 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
Re: [android-developers] help on dalvik VM.
On Wed, Sep 14, 2011 at 9:59 PM, Pratik Prajapati 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
[android-developers] help on dalvik VM.
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? -- Regards, Pratik Prajapati -- 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