Replies: 2 comments
-
Perhaps someone can run apktool inside a java profiler and see where these allocations are coming from Also, I can mention that the virtual memory is consistently in the >3GB range. While that does seem a bit high to me, it's not a "problem" in that it's not limiting anything. However, high RSS is an actual physical limit that reduces the ability to run apktool in parallel |
Beta Was this translation helpful? Give feedback.
-
You have to remember that the source APK is not the only package being loaded/utilized. The framework file (as of API 24) is about a 2.7M apk and that is loaded on every decode. I did find a problem where we are reloading the same framework APK twice, which is highly inefficient. The next major slowdown point comes from unknown files as it creates a new zip (apk) on the fly as it injects those unknown files. I'll have to look into editing the same file vs a tmp file. Finally, a lot of string manipulation is hurting the runtime, according to the profiler. I do have lots and lots of crashing bugs to fix though, so optimization has unfortunately fallen behind. I'll do my best for the easy solutions, but any fix requiring a good deal of rewriting will probably have to wait. |
Beta Was this translation helpful? Give feedback.
-
As seen below, a 500KB apk uses up to 176MB (a 300x increase!!) of memory when decoding just the smali, without resources. This makes large scale analysis of many APKs very hard. I'm wondering if something can be done to reduce this. I found a related issue JesusFreke/smali#181 that says this should not be a problem, but that's not my experience. Posting on apktool project in hopes there can be some command line flag (like --low-mem) that trades speed for memory if a user needs that option.
This happens across all APKs I'm working with.
Note: To retest this on Mac, use
/usr/bin/time -l apktool....
and note that the output of RSS is supposedly in bytes for OS X.Information
apktool -version
) - 2.2.1Steps to Reproduce
Beta Was this translation helpful? Give feedback.
All reactions