butzist/ActivityLauncher

Out of memory when scanning Applications

Closed this issue · 2 comments

When I launched the app, it started to scan for activities, and crashed when scanned for about 500 activities. Here's the log and stacktrace for the crash:

[Device Brand]: OnePlus
[Device Model]: PJE110
[Display]: PJE110_14.0.0.812(CN01)
[Android Version]: 14
[Android API Level]: 34
[System Locale]: zh_CN
[Process ID]: 6568
[User ID]: 0
[CPU ABI]: none
[Package Name]: de.szalkowski.activitylauncher
[Version Name]: 1.15.2
[Version Code]: 41
[Target SDK]: 33
[Min SDK]: 19
[Error Type]: JVM
[Crash Time]: 2024-10-07T16:41:24.975
[Stack Trace]:
java.lang.RuntimeException: An error occurred while executing doInBackground()
	at android.os.AsyncTask$4.done(AsyncTask.java:415)
	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:407)
	at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
	at java.util.concurrent.FutureTask.run(FutureTask.java:295)
	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 136 byte allocation with 402064 free bytes and 392KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
	at libcore.io.Linux.access(Native Method)
	at libcore.io.ForwardingOs.access(ForwardingOs.java:128)
	at libcore.io.BlockGuardOs.access(BlockGuardOs.java:76)
	at libcore.io.ForwardingOs.access(ForwardingOs.java:128)
	at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:8837)
	at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:313)
	at java.io.File.exists(File.java:813)
	at android.content.res.OplusThemeZipFile.isValidThemeFile(OplusThemeZipFile.java:305)
	at android.content.res.OplusThemeZipFile.getThemeZipFile(OplusThemeZipFile.java:237)
	at android.content.res.OplusThemeResources.checkUpdate(OplusThemeResources.java:162)
	at android.content.res.OplusThemeResources.<init>(OplusThemeResources.java:103)
	at android.content.res.OplusThemeResourcesPackage.<init>(OplusThemeResourcesPackage.java:35)
	at android.content.res.OplusThemeResourcesPackage.getTopLevelThemeResources(OplusThemeResourcesPackage.java:65)
	at android.content.res.OplusThemeResourcesPackage.getThemeResources(OplusThemeResourcesPackage.java:48)
	at android.content.res.ResourcesImplExt.initThemeResource(ResourcesImplExt.java:437)
	at android.content.res.ResourcesImplExt.init(ResourcesImplExt.java:137)
	at android.app.ApplicationPackageManagerExtImpl.modifyResultInGetResourcesForApplication(ApplicationPackageManagerExtImpl.java:124)
	at android.app.ApplicationPackageManager.getResourcesForApplication(ApplicationPackageManager.java:2163)
	at android.app.ApplicationPackageManager.getResourcesForApplication(ApplicationPackageManager.java:2141)
	at android.app.ApplicationPackageManager.getResourcesForApplication(ApplicationPackageManager.java:2173)
	at d1.p.a(SourceFile:17)
	at d1.q.a(SourceFile:147)
	at d1.r.a(SourceFile:1)
	at d1.i.doInBackground(SourceFile:108)
	at android.os.AsyncTask$3.call(AsyncTask.java:394)
	at java.util.concurrent.FutureTask.run(FutureTask.java:290)
	... 4 more

Try with v.2.x, if the same - android:largeHeap="true" can be included in the Manifest, you can do it yourself as well by editing the .apk (assuming standalone, not a bundle from PS) with MT Manager and do a clean install, because you will have to resign and get a signature mismatch if you try to install/update over.

Just noticed that the app is not in the latest version. Maybe I messed the Google Play version with the F-Droid one. Fixed in v2.0.2.