loloof64
04/26/2021, 3:22 PM@Composable
, I know which part of code is responsible, but don't know exactly how to fix the issue. More on threadloloof64
04/26/2021, 3:23 PM@Composable
. In next post, I'll post relevant part.dewildte
04/26/2021, 3:24 PMloloof64
04/26/2021, 3:24 PMColton Idle
04/26/2021, 3:24 PMColton Idle
04/26/2021, 3:24 PMloloof64
04/26/2021, 3:26 PMexecuteInstalledEngine
is a long running task : hence the coroutine scope. But my implementation seems unefficient.loloof64
04/26/2021, 3:27 PMloloof64
04/26/2021, 3:38 PMSelectEngineDialog
is a wrapper around AlertDialog
: if user click on item from its LazyColumn
, a process is run in order to launch the selected chess engine.Zach Klippenstein (he/him) [MOD]
04/26/2021, 3:39 PMCoroutineContext
into a composable smells bad, and Iโd bet your leak is probably related to that. All composable functions implicitly have their own coroutine scope, effectively, and that is the scope that should be used for coroutines launched from the composable - they will automatically
be cancelled if the composable gets skipped.loloof64
04/26/2021, 3:42 PMCoroutineScope
as I wanted to avoid to create two CoroutineScope
for the parent, and its child. But it seems that's what I should do ๐ So first, I try with creating two CoroutineScope
instead of sharing.loloof64
04/26/2021, 3:49 PMexecuteInstalledEngine
.loloof64
04/26/2021, 3:49 PMloloof64
04/26/2021, 3:50 PMcurrentRunner
.Zach Klippenstein (he/him) [MOD]
04/26/2021, 3:54 PMloloof64
04/26/2021, 3:56 PMZach Klippenstein (he/him) [MOD]
04/26/2021, 3:59 PMloloof64
04/26/2021, 4:00 PMGabriel Melo
04/26/2021, 4:42 PMContext
on that method? Retaining an instance of it after its provider has been destroyed is a frequent reason for leaks.Gabriel Melo
04/26/2021, 4:43 PMContext
into another function that is not long-running and see if it improves things.Gabriel Melo
04/26/2021, 4:44 PMContext
, Activity
and Fragment
are always dangerous in my experience.loloof64
04/26/2021, 9:12 PMContext
in order to access private folder of applicationloloof64
04/26/2021, 9:13 PMloloof64
04/26/2021, 9:14 PMFile
instance from another method, a short-lived one ๐loloof64
04/26/2021, 9:16 PMFile
object as a parameter : and PackageManager
for some other methods.loloof64
04/26/2021, 9:39 PMloloof64
04/26/2021, 10:03 PMGabriel Melo
04/27/2021, 11:17 AMloloof64
04/27/2021, 6:03 PMloloof64
04/27/2021, 6:03 PMI/art: Background partial concurrent mark sweep GC freed 5010(5MB) AllocSpace objects, 447(8MB) LOS objects, 16% free, 19MB/23MB, paused 1.478ms total 100.939ms
I/art: Background partial concurrent mark sweep GC freed 4994(5MB) AllocSpace objects, 449(8MB) LOS objects, 16% free, 20MB/24MB, paused 1.459ms total 107.312ms
I/art: Background partial concurrent mark sweep GC freed 5237(5MB) AllocSpace objects, 475(9MB) LOS objects, 16% free, 20MB/24MB, paused 1.534ms total 104.432ms
I/art: Background partial concurrent mark sweep GC freed 5345(6MB) AllocSpace objects, 492(9MB) LOS objects, 16% free, 20MB/24MB, paused 1.542ms total 112.015ms
I/art: Background partial concurrent mark sweep GC freed 5553(6MB) AllocSpace objects, 510(9MB) LOS objects, 15% free, 21MB/25MB, paused 1.528ms total 113.323ms
I/art: Background partial concurrent mark sweep GC freed 5754(6MB) AllocSpace objects, 528(10MB) LOS objects, 15% free, 21MB/25MB, paused 1.667ms total 120.876ms
I/art: Background partial concurrent mark sweep GC freed 5743(6MB) AllocSpace objects, 513(10MB) LOS objects, 15% free, 21MB/25MB, paused 1.599ms total 115.166ms
I/art: Background partial concurrent mark sweep GC freed 5604(6MB) AllocSpace objects, 507(9MB) LOS objects, 15% free, 21MB/25MB, paused 1.540ms total 117.786ms
I/art: Background partial concurrent mark sweep GC freed 5895(6MB) AllocSpace objects, 554(10MB) LOS objects, 15% free, 22MB/26MB, paused 1.582ms total 126.550ms
I/art: Background partial concurrent mark sweep GC freed 5961(6MB) AllocSpace objects, 538(10MB) LOS objects, 15% free, 22MB/26MB, paused 1.556ms total 123.707ms
I/art: Background partial concurrent mark sweep GC freed 5969(6MB) AllocSpace objects, 548(10MB) LOS objects, 14% free, 23MB/27MB, paused 1.623ms total 129.052ms
I/art: Background partial concurrent mark sweep GC freed 6311(7MB) AllocSpace objects, 580(11MB) LOS objects, 14% free, 23MB/27MB, paused 1.749ms total 137.854ms
I/art: Background partial concurrent mark sweep GC freed 6355(7MB) AllocSpace objects, 580(11MB) LOS objects, 14% free, 23MB/27MB, paused 1.641ms total 137.932ms
I/art: Background partial concurrent mark sweep GC freed 6112(6MB) AllocSpace objects, 545(10MB) LOS objects, 14% free, 23MB/27MB, paused 1.628ms total 145.860ms
I/art: Background partial concurrent mark sweep GC freed 6586(7MB) AllocSpace objects, 628(12MB) LOS objects, 14% free, 24MB/28MB, paused 1.812ms total 152.395ms
I/art: Background partial concurrent mark sweep GC freed 6180(6MB) AllocSpace objects, 527(10MB) LOS objects, 14% free, 24MB/28MB, paused 1.636ms total 145.680ms
I/art: Background partial concurrent mark sweep GC freed 6424(7MB) AllocSpace objects, 613(11MB) LOS objects, 13% free, 24MB/28MB, paused 1.868ms total 147.552ms
I/art: Background partial concurrent mark sweep GC freed 6973(7MB) AllocSpace objects, 651(12MB) LOS objects, 13% free, 25MB/29MB, paused 1.758ms total 155.076ms
I/art: Background partial concurrent mark sweep GC freed 7246(8MB) AllocSpace objects, 671(13MB) LOS objects, 13% free, 25MB/29MB, paused 1.802ms total 158.771ms
I/art: Background partial concurrent mark sweep GC freed 7619(8MB) AllocSpace objects, 717(14MB) LOS objects, 13% free, 26MB/30MB, paused 1.959ms total 172.607ms
I/art: Background partial concurrent mark sweep GC freed 7883(8MB) AllocSpace objects, 729(14MB) LOS objects, 13% free, 26MB/30MB, paused 1.952ms total 175.818ms
I/art: Background partial concurrent mark sweep GC freed 7770(8MB) AllocSpace objects, 716(13MB) LOS objects, 12% free, 26MB/30MB, paused 1.872ms total 175.913ms
I/art: Background partial concurrent mark sweep GC freed 7695(8MB) AllocSpace objects, 702(13MB) LOS objects, 12% free, 26MB/30MB, paused 1.876ms total 170.383ms
I/art: Background partial concurrent mark sweep GC freed 7916(9MB) AllocSpace objects, 745(14MB) LOS objects, 12% free, 27MB/31MB, paused 1.989ms total 182.644ms
I/art: Background partial concurrent mark sweep GC freed 8126(9MB) AllocSpace objects, 757(14MB) LOS objects, 12% free, 27MB/31MB, paused 2.055ms total 184.057ms
I/System: FinalizerDaemon: finalize objects = 35788
I/art: Background partial concurrent mark sweep GC freed 8390(9MB) AllocSpace objects, 794(15MB) LOS objects, 12% free, 29MB/33MB, paused 1.997ms total 205.145ms
I/art: Background partial concurrent mark sweep GC freed 8279(9MB) AllocSpace objects, 743(14MB) LOS objects, 12% free, 28MB/32MB, paused 1.977ms total 185.077ms
I/art: Background partial concurrent mark sweep GC freed 8210(9MB) AllocSpace objects, 766(14MB) LOS objects, 12% free, 28MB/32MB, paused 1.910ms total 188.075ms
I/art: Background partial concurrent mark sweep GC freed 8889(10MB) AllocSpace objects, 861(16MB) LOS objects, 11% free, 29MB/33MB, paused 2.130ms total 214.342ms
loloof64
04/27/2021, 6:05 PMContext
in some methods of ChessEngineUtils.
As I needed to access context.PackageManager
and I felt like it would not change anything to remove context
parameter in such case.loloof64
04/28/2021, 9:43 AMloloof64
04/28/2021, 9:45 AMloloof64
04/28/2021, 10:09 AMloloof64
04/28/2021, 12:14 PMBufferedReader#readLine()
. A simple check with BufferedReader#isReady()
solved it.