APKParser
APKParser copied to clipboard
OutOfMemoryError for when VM heap is too low
If the VM heap is 32MB, and you try to load the app of package name "android" (app label is "Android System") and you run it on the emulator, it gets an OOM:
Caused by: java.lang.OutOfMemoryError at com.jaredrummler.apkparser.parser.ResourceTableParser.readPackage(ResourceTableParser.java:119) at com.jaredrummler.apkparser.parser.ResourceTableParser.parse(ResourceTableParser.java:67) at com.jaredrummler.apkparser.ApkParser.parseResourceTable(ApkParser.java:417) at com.jaredrummler.apkparser.ApkParser.transBinaryXml(ApkParser.java:269) at com.jaredrummler.apkparser.ApkParser.parseManifestXml(ApkParser.java:207) at com.jaredrummler.apkparser.ApkParser.parseApkMeta(ApkParser.java:199) at com.jaredrummler.apkparser.ApkParser.getApkMeta(ApkParser.java:150) at com.jaredrummler.apkparser.ApkParser.getAndroidManifest(ApkParser.java:140)
Is there a way to overcome this? To somehow minimize memory usage further?
I don't have the time to look into this but PR are welcome.
Do you know perhaps what takes so much memory? It just parses APK files, and even then, just tiny stuff from there, no?