我有一个相对简单的React Native(Android)应用程序,位于大厅。它由4个简单的屏幕组成,允许用户选择他/她的名字,在地图上选择一个位置,然后重新启动该过程。
经常运行约5天后,应用程序崩溃......嗯,它实际上并没有崩溃。我们正在使用Crashlytics而且我们没有收到崩溃报告,而且该应用实际上并未关闭;它只是进入概述屏幕并显示Launcher3
(见下图)。
我不知道是什么原因造成这个错误。知道是什么引起了这个吗?或者至少,有关我如何进行调试的任何建议?
依赖关系:
"dependencies": {
"prop-types": "^15.5.8",
"react": "15.5.4",
"react-native": "0.42.3",
"react-native-fabric": "^0.4.1",
"react-native-keep-awake": "2.0.4",
"react-native-maps": "0.13.1",
"react-navigation": "1.0.0-beta.9",
"react-redux": "5.0.4",
"redux": "3.6.0",
"redux-thunk": "2.2.0"
},
"devDependencies": {
"babel-jest": "20.0.0",
"babel-plugin-module-resolver": "^2.7.0",
"babel-preset-react-native": "1.9.1",
"jest": "20.0.0",
"react-test-renderer": "15.5.4"
},
"jest": {
"preset": "react-native"
}
它越来越可能认为这是一个内存问题。以下是问题开始发生时日志的片段:
[1077527.452315] binder: release 15127:15138 transaction 80204186 in, still active
[1077527.452330] binder: send failed reply for transaction 80204186 to 15092:15126
[1077527.459627] binder: 15092: binder_alloc_buf, no vma
[1077527.459644] binder: 980:3503 transaction failed 29201, size 88-4
[1077527.493244] binder: release 15141:15141 transaction 80204387 out, still active
[1077527.562781] binder: 980:5223 transaction failed 29189, size 1940-8
[1077527.562797] binder: send failed reply for transaction 80204387, target dead
[1077528.120965] lowmemorykiller: Killing 'e.process.gapps' (15171), adj 0,
[1077528.120965] to free 37840kB on behalf of 'kswapd0' (111) because
[1077528.120965] cache 13264kB is below limit 61440kB for oom_score_adj 0
[1077528.120965] Free memory is 9376kB above reserved.
[1077528.120965] Free CMA is 10300kB
[1077528.120965] Total reserve is 21676kB
[1077528.120965] Total free pages is 22100kB
[1077528.120965] Total file cache is 136564kB
[1077528.120965] Slab Reclaimable is 9452kB
[1077528.120965] Slab UnReclaimable is 535236kB
[1077528.120965] Total Slab is 544688kB
[1077528.120965] GFP mask is 0xd0
[1077528.153006] lowmemorykiller: Killing '.gms.persistent' (15158), adj 0,
[1077528.153006] to free 36220kB on behalf of 'kswapd0' (111) because
[1077528.153006] cache 13016kB is below limit 61440kB for oom_score_adj 0
[1077528.153006] Free memory is 9452kB above reserved.
[1077528.153006] Free CMA is 10300kB
[1077528.153006] Total reserve is 21676kB
[1077528.153006] Total free pages is 27744kB
[1077528.153006] Total file cache is 136788kB
[1077528.153006] Slab Reclaimable is 9452kB
[1077528.153006] Slab UnReclaimable is 535236kB
[1077528.153006] Total Slab is 544688kB
[1077528.153006] GFP mask is 0xd0
[1077528.179007] binder: 15158: binder_alloc_buf, no vma
[1077528.179024] binder: 980:994 transaction failed 29201, size 88-4
[1077531.534580] CHG: get_prop_capacity: soc samples[0] = 100
[1077531.534597] CHG: get_prop_capacity: soc samples[1] = 100
[1077531.534608] CHG: get_prop_capacity: soc samples[2] = 100
[1077531.534618] CHG: get_prop_capacity: soc samples[3] = 100
[1077531.537690] BMS_DEBUG 107535 16:28:30 4177573 100% 266C
[1077531.544665] CHG: get_prop_capacity: soc samples[0] = 100
[1077531.544680] CHG: get_prop_capacity: soc samples[1] = 100
[1077531.544691] CHG: get_prop_capacity: soc samples[2] = 100
[1077531.544700] CHG: get_prop_capacity: soc samples[3] = 100
[1077531.548164] CHG: get_prop_capacity: soc samples[0] = 100
[1077531.548178] CHG: get_prop_capacity: soc samples[1] = 100
[1077531.548188] CHG: get_prop_capacity: soc samples[2] = 100
[1077531.548197] CHG: get_prop_capacity: soc samples[3] = 100
[1077537.472422] type=1400 audit(1496766516.553:45833): avc: denied { search } for pid=2370 comm="ndroid.systemui" name="15206" dev="proc" ino=12174739 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:system_app:s0 tclass=dir permissive=0
[1077537.472735] type=1400 audit(1496766516.553:45834): avc: denied { search } for pid=2370 comm="ndroid.systemui" name="15206" dev="proc" ino=12174739 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:system_app:s0 tclass=dir permissive=0
[1077537.472999] type=1400 audit(1496766516.553:45835): avc: denied { search } for pid=2370 comm="ndroid.systemui" name="15206" dev="proc" ino=12174739 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:r:system_app:s0 tclass=dir permissive=0
[1077541.017542] init: Service 'atfwd' (pid 9821) exited with status 255
[1077541.017582] init: Service 'atfwd' (pid 9821) killing any children in process group
[1077541.018827] init: Starting service 'atfwd'...
答案 0 :(得分:0)
几天前我遇到类似的问题我通过简单地删除node_modules然后安装了新的node_modules来解决它,或者如果你正在运行yarn,那么请运行yarn upgrade
。
答案 1 :(得分:0)
此问题是由Marshmallow的核心Android操作系统中的已知内存泄漏引起的。它只是它的方式,他们不打算修复它......