Compressor
Compressor copied to clipboard
OutOfMemoryError with WorkManager CoroutineWorker
I just upgraded to the kotlin version (3.0.0) and changed my worker to a CoroutineWorker since Compressor.compress() now needs a suspending method. However, now I get java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError every time.
I also tried to change from this
override suspend fun doWork(): Result { }
to this
override suspend fun doWork(): Result = withContext(Dispatchers.IO){ }
but that doesn't change anything. Any idea why the new versino causes a systematic memory leak in my WorkManager ? I also implemented it elsewhere in a fragment with a standard lifecycleScope.launch { } and it runs without any problem.
Hi,
thanks for the quick response. Yes, I've tried implementing it exactly as documented and with tweaks here and there but it seems I'm still missing out something. In the kotlin version you're implementing a "copyCache()" method, could it be that?
On Sat, 1 Feb 2020 at 03:58, Zetra [email protected] wrote:
Have you tried using CoroutineWorker https://developer.android.com/topic/libraries/architecture/workmanager/advanced/coroutineworker ?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zetbaitsu/Compressor/issues/139?email_source=notifications&email_token=ACXRUJZ2BBRKYG55GEQGTDLRATQL5A5CNFSM4KOPORQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKQRYCA#issuecomment-580983816, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXRUJYK3G4S4LZONONLZQTRATQL5ANCNFSM4KOPORQA .