Android N App performance is very slow

I am using following tools,
Xamarin 4.6.0.297 (4a8abec)
Xamarin.Android 7.4.0.19 (0cd0214)
Xamarin.iOS 10.12.0.14 (bf350ba)

Problem:
I found that the application is running on Android N is very slow, whereas on Android M & below it works fine.

I found following issues:
1. Async await call to sqlite database is very slow, sometimes it takes 8-10 seconds.
2. Very aggressive GC, which pause app & make database calls slow (app pause for few seconds when GC performs its action).
3. View pager working very slow after update of Xamarin, previously it was working fine (Also it only happens on Android N).
4. Overall app performance is too slow.

Work around tried:
1. Set GC to use old, new & tarjan but any of these is not working.

I captured few logs in debug mode. They are as follows:

08-21 19:43:37.259 I/art (18140): Starting a blocking GC Explicit
08-21 19:43:37.283 I/art (18140): Explicit concurrent mark sweep GC freed 1902(80KB) AllocSpace objects, 9(5MB) LOS objects, 24% free, 48MB/64MB, paused 334us total 24.006ms
08-21 19:43:37.284 D/Mono (18140): GC_TAR_BRIDGE bridges 34 objects 38 opaque 8 colors 34 colors-bridged 34 colors-visible 34 xref 7 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.05ms tarjan 0.04ms scc-setup 0.01ms gather-xref 0.00ms xref-setup 0.00ms cleanup 0.04ms
08-21 19:43:37.284 D/Mono (18140): GC_BRIDGE: Complete, was running for 25.41ms
08-21 19:43:37.284 D/Mono (18140): GC_MINOR: (Nursery full) time 2.11ms, stw 3.80ms promoted 34K major size: 9424K in use: 5474K los size: 20848K in use: 15303K
08-21 19:43:39.331 D/Mono (18140): GC_BRIDGE waiting for bridge processing to finish
08-21 19:43:39.331 I/art (18140): Starting a blocking GC Explicit
08-21 19:43:39.354 I/art (18140): Explicit concurrent mark sweep GC freed 140(5KB) AllocSpace objects, 0(0B) LOS objects, 24% free, 48MB/64MB, paused 413us total 22.660ms
08-21 19:43:39.355 D/Mono (18140): GC_TAR_BRIDGE bridges 1 objects 1 opaque 0 colors 1 colors-bridged 1 colors-visible 1 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.10ms tarjan 0.01ms scc-setup 0.03ms gather-xref 0.00ms xref-setup 0.00ms cleanup 0.02ms
08-21 19:43:39.355 D/Mono (18140): GC_BRIDGE: Complete, was running for 23.51ms
08-21 19:43:39.355 D/Mono (18140): GC_MINOR: (Nursery full) time 3.42ms, stw 5.08ms promoted 544K major size: 9488K in use: 6074K los size: 20848K in use: 15389K
08-21 19:43:41.563 I/art (18140): Starting a blocking GC Explicit
08-21 19:43:41.586 I/art (18140): Explicit concurrent mark sweep GC freed 1746(81KB) AllocSpace objects, 0(0B) LOS objects, 24% free, 48MB/64MB, paused 358us total 23.113ms
08-21 19:43:41.588 D/Mono (18140): GC_TAR_BRIDGE bridges 204 objects 893 opaque 1584 colors 204 colors-bridged 204 colors-visible 204 xref 68 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.15ms tarjan 0.77ms scc-setup 0.09ms gather-xref 0.01ms xref-setup 0.00ms cleanup 0.10ms
08-21 19:43:41.588 D/Mono (18140): GC_BRIDGE: Complete, was running for 27.28ms
08-21 19:43:41.589 D/Mono (18140): GC_MINOR: (Nursery full) time 5.97ms, stw 7.57ms promoted 617K major size: 9792K in use: 6750K los size: 20848K in use: 15389K
08-21 19:43:43.688 D/Mono (18140): GC_TAR_BRIDGE bridges 0 objects 0 opaque 0 colors 0 colors-bridged 0 colors-visible 204 xref 68 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.15ms tarjan 0.77ms scc-setup 0.09ms gather-xref 0.01ms xref-setup 0.00ms cleanup 0.01ms
08-21 19:43:43.688 D/Mono (18140): GC_BRIDGE: Complete, was running for 0.07ms
08-21 19:43:43.688 D/Mono (18140): GC_MINOR: (Nursery full) time 3.25ms, stw 4.91ms promoted 604K major size: 10256K in use: 7415K los size: 20848K in use: 15398K
08-21 19:43:45.797 D/Mono (18140): GC_TAR_BRIDGE bridges 0 objects 0 opaque 0 colors 0 colors-bridged 0 colors-visible 204 xref 68 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.15ms tarjan 0.77ms scc-setup 0.09ms gather-xref 0.01ms xref-setup 0.00ms cleanup 0.02ms
08-21 19:43:45.797 D/Mono (18140): GC_BRIDGE: Complete, was running for 0.08ms
08-21 19:43:45.797 D/Mono (18140): [0x7f6fbf7450] worker unparking, timeout? no interrupted? no
08-21 19:43:45.797 D/Mono (18140): GC_MINOR: (Nursery full) time 3.29ms, stw 5.08ms promoted 588K major size: 10720K in use: 8061K los size: 20848K in use: 15398K
08-21 19:43:47.927 D/Mono (18140): GC_TAR_BRIDGE bridges 0 objects 0 opaque 0 colors 0 colors-bridged 0 colors-visible 204 xref 68 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.15ms tarjan 0.77ms scc-setup 0.09ms gather-xref 0.01ms xref-setup 0.00ms cleanup 0.03ms
08-21 19:43:47.927 D/Mono (18140): GC_BRIDGE: Complete, was running for 0.10ms
08-21 19:43:47.928 D/Mono (18140): GC_MINOR: (Nursery full) time 3.24ms, stw 5.15ms promoted 551K major size: 11216K in use: 8667K los size: 20848K in use: 15414K
08-21 19:43:50.109 D/Mono (18140): GC_TAR_BRIDGE bridges 0 objects 0 opaque 0 colors 0 colors-bridged 0 colors-visible 204 xref 68 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.15ms tarjan 0.77ms scc-setup 0.09ms gather-xref 0.01ms xref-setup 0.00ms cleanup 0.00ms
08-21 19:43:50.109 D/Mono (18140): GC_BRIDGE: Complete, was running for 0.07ms
08-21 19:43:50.109 D/Mono (18140): GC_MINOR: (Nursery full) time 3.20ms, stw 5.10ms promoted 557K major size: 11648K in use: 9281K los size: 20848K in use: 15414K
08-21 19:43:52.284 D/Mono (18140): GC_TAR_BRIDGE bridges 0 objects 0 opaque 0 colors 0 colors-bridged 0 colors-visible 204 xref 68 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.15ms tarjan 0.77ms scc-setup 0.09ms gather-xref 0.01ms xref-setup 0.00ms cleanup 0.01ms
08-21 19:43:52.285 D/Mono (18140): GC_BRIDGE: Complete, was running for 0.07ms
08-21 19:43:52.285 D/Mono (18140): GC_MINOR: (Nursery full) time 3.22ms, stw 4.96ms promoted 513K major size: 12112K in use: 9845K los size: 20848K in use: 15414Kmeout? no interrupted? no
08-21 19:43:54.433 D/Mono (18140): GC_TAR_BRIDGE bridges 0 objects 0 opaque 0 colors 0 colors-bridged 0 colors-visible 204 xref 68 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.15ms tarjan 0.77ms scc-setup 0.09ms gather-xref 0.01ms xref-setup 0.00ms cleanup 0.02ms
08-21 19:43:54.433 D/Mono (18140): GC_BRIDGE: Complete, was running for 0.08ms
08-21 19:43:54.433 D/Mono (18140): GC_MINOR: (Nursery full) time 3.38ms, stw 5.18ms promoted 525K major size: 12608K in use: 10423K los size: 20848K in use: 15414K

Please, have a look & let me know your suggestions on it.

Posts

  • DRSouzaDRSouza USMember

    Same problem here. Any solution?

  • sudheeshvpsudheeshvp USMember ✭✭

    i am facing the above issue,i think it is thread concurrency issue,
    if anybody have exact solution,please comment here

Sign In or Register to comment.