Hi Team,
We are using the XF ListView and loaded a normal view(i.e., three labels and one image) in the ItemTemplate property and defined the CachingStrategy as “RecycleElement”. While scrolling continuously by fling action, scrolling gets stuck at some time in Android platform. Since, we are using the Xamarin Forms version 2.4.0.280 and TargetFrameworkVersion of Android is 7.1.
For your information, we have noticed that when the scrolling gets stuck in UI, at this time GC gets collected in the output window and we suspect that this degradation in scrolling(stuck) arises while GC gets collected.
11-09 12:44:37.365 I/art (18496): Starting a blocking GC Explicit
11-09 12:44:37.397 I/art (18496): Explicit concurrent mark sweep GC freed 314(9KB) AllocSpace objects, 6(504KB) LOS objects, 39% free, 7MB/12MB, paused 566us total 32.261ms
11-09 12:44:37.400 D/Mono (18496): GC_TAR_BRIDGE bridges 107 objects 209 opaque 10 colors 107 colors-bridged 107 colors-visible 107 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.12ms tarjan 0.38ms scc-setup 0.11ms gather-xref 0.01ms xref-setup 0.00ms cleanup 0.04ms
11-09 12:44:37.400 D/Mono (18496): GC_BRIDGE: Complete, was running for 35.94ms
11-09 12:44:37.400 D/Mono (18496): GC_MAJOR: (LOS overflow) time 33.08ms, stw 35.23ms los size: 2048K in use: 112K
11-09 12:44:37.400 D/Mono (18496): GC_MAJOR_SWEEP: major size: 2048K in use: 1158K
11-09 12:44:39.167 D/Mono (18496): GC_BRIDGE waiting for bridge processing to finish
Can you please look into this and revert us the further details asap. We have attached the screenshot and sample too for your reference.
Also, can you please explain or provide a solution on how to overcome from this bug if custom controls are used. Since, it was replicated in custom controls too.
Step 1: Run the attached sample in Android platform.
Step 2: Open the Output window
Step 3: Now the ListView is loaded and lot of logcat is displayed in output window.
Step 4: Clear the logcat from the output window.
Step 5: Perform fling action continuously.
Step 6: Note that GC collect logcat is displayed in the output window when scrolling gets stuck.(Issue)
There should not be any lag while scrolling the list.
A small lag could be seen while GC collection.
This issue is already being dragged for a very long time. Please see the bugzilla report below.
https://bugzilla.xamarin.com/show_bug.cgi?id=60588
Please look into it with high priority and provide suitable solution as soon as possible .
https://github.com/xamarin/Xamarin.Forms/pull/4000
Perhaps it' something related to this issue
4000
Perhaps it' something related to this issue
It is not. #4000 is referring to programmatic ScrollTo calls. This issue is about manual scrolling by the user being choppy because of garbage collection pauses.
Any updated on this?
@srdmnc just wonder, have you tried CollectionView yet?
@AndreiMisiukevich I haven't because based on the reviews on XF v.4.2 CollectionView doesn't have a pull-to-refresh capability. But based on this article, it has now (v.4.3.0). Anyways, the lag in scrolling happens only when the device is connected to my machine during debugging. Otherwise, it works fine.
Thanks.
@srdmnc just wonder, have you tried CollectionView yet?
I have tried the collection view and it also suffers from laggy scrolling on Android.
Most helpful comment
I have tried the collection view and it also suffers from laggy scrolling on Android.