App的ListView里面有太多的图片,滑动一下内存就爆掉了
* thread #16, name = 'io.worker.4', stop reason = EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=3072 MB, unused=0x0)
frame #0: 0x0000000105d20b50 Flutter`ycc_rgb_convert + 140
Flutter`ycc_rgb_convert:
-> 0x105d20b50 <+140>: strb w21, [x5]
0x105d20b54 <+144>: ldr x21, [x12, x19, lsl #3]
0x105d20b58 <+148>: ldr x20, [x11, x20, lsl #3]
0x105d20b5c <+152>: add x20, x20, x21
Target 0: (Runner) stopped.
Lost connection to device.
看报错信息大致是内存不够用了
解决办法:
设置memCacheHeight和memCacheWidth
AspectRatio(
aspectRatio: 1,
child: CachedNetworkImage(
imageUrl: item.imageUrl,
memCacheHeight: 200,
memCacheWidth: 200,
),
),