一共碰到好几次,肉鸽一次,看剧情2次。
现象可以确定是游戏启动刚好一个小时后刚好必闪退,不论是开图还是看剧情。
我是用的电脑模拟器玩。
编辑:
简单描述下,原因是因为我用的模拟器配置的dalvik heap limit没有优化。而鹰角这次更新对heap的分配增大了,导致碰到上限OOM。
按我的理解,应该就是鹰角没有对4G内存以下的设备进行长时间测试,估计都有这个问题
4/10 编辑:
由于今天又闪退了,于是我又认真排查了下,
首先可以确认确实是内存泄漏导致,并且内存泄漏的原因是yj客户端里面集成的Reyun广告跟踪sdk,前面贴过。
有几个现象,
1,logcat 每秒就会有一行 ReyunDB : Database was already opened!1
2,客户端进程网络跟踪发现 每秒会请求 172.16.1.2.56889 这种不存在的地址
搜索reyun找到如下文件
data/data/com.hypergryph.arknights/Reyun.db* 文件
删除该文件确认问题完美解决,并且 dumpsys meminfo 2194 时候,Dalvik Heap 也不会再增加。当然,如果你删除游戏重新安装,也是能解决的。
Reyun第三方sdk出现该问题的有两个原因:
1,用户曾经更改过设备名称,这在实际手机上基本是不可能出现的,因为设备型号是死的。但是模拟器就不一样了,有的模拟器带设备名更改功能,会导致这类广告跟踪数据异常
2,用户曾经允许游戏app读取手机信息,但是之后又通过android设置,不允许读取手机信息。导致该sdk 里面跟踪匹配不到明日方舟的id号,而变成重复新跟踪id。
如果你动过上面两个配置,我建议卸载重装游戏保持新鲜的appdata
```
04-08 16:56:28.631 1689 1689 I gryph.arknight: Clamp target GC heap from 239MB to 192MB
04-08 16:56:28.631 1689 1689 I gryph.arknight: Alloc concurrent copying GC freed 49(1560B) AllocSpace objects, 0(0B) LOS objects, 0% free, 191MB/192MB, paused 24us total 19.695ms
04-08 16:56:28.631 1689 1689 W gryph.arknight: Throwing OutOfMemoryError "Failed to allocate a 294920 byte allocation with 248352 free bytes and 242KB until OOM, target footprint 201326592, growth limit 201326592" (VmSize 2919768 kB)
04-08 16:56:28.631 1689 1689 I gryph.arknight: Starting a blocking GC Alloc
04-08 16:56:28.632 1689 1689 I gryph.arknight: Starting a blocking GC Alloc
04-08 16:56:28.637 6972 6972 I [minigbm:gbm_mesa_internals.cpp(233)]: Found GPU amdgpu
04-08 16:56:28.640 1689 1689 I gryph.arknight: Alloc young concurrent copying GC freed 7(560B) AllocSpace objects, 0(0B) LOS objects, 0% free, 191MB/192MB, paused 22us total 8.657ms
04-08 16:56:28.640 1689 1689 I gryph.arknight: Starting a blocking GC Alloc
04-08 16:56:28.664 1689 1689 I gryph.arknight: Clamp target GC heap from 239MB to 192MB
04-08 16:56:28.664 1689 1689 I gryph.arknight: Alloc concurrent copying GC freed 7(152B) AllocSpace objects, 0(0B) LOS objects, 0% free, 191MB/192MB, paused 44us total 23.651ms
04-08 16:56:28.664 1689 1689 I gryph.arknight: Forcing collection of SoftReferences for 288KB allocation
04-08 16:56:28.664 1689 1689 I gryph.arknight: Starting a blocking GC Alloc
04-08 16:56:28.683 1689 1689 I gryph.arknight: Clamp target GC heap from 239MB to 192MB
04-08 16:56:28.684 1689 1689 I gryph.arknight: Alloc concurrent copying GC freed 8(208B) AllocSpace objects, 0(0B) LOS objects, 0% free, 191MB/192MB, paused 23us total 19.373ms
04-08 16:56:28.684 1689 1689 W gryph.arknight: Throwing OutOfMemoryError "Failed to allocate a 294920 byte allocation with 248352 free bytes and 242KB until OOM, target footprint 201326592, growth limit 201326592" (VmSize 2919760 kB)
04-08 16:56:28.684 1689 1689 D AndroidRuntime: Shutting down VM
--------- beginning of crash
04-08 16:56:28.684 1689 1689 E AndroidRuntime: FATAL EXCEPTION: main
04-08 16:56:28.684 1689 1689 E AndroidRuntime: Process: com.hypergryph.arknights, PID: 1689
04-08 16:56:28.684 1689 1689 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 294920 byte allocation with 248352 free bytes and 242KB until OOM, target footprint 201326592, growth limit 201326592
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at java.util.Arrays.copyOf(Arrays.java:3257)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:649)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at java.lang.StringBuilder.append(StringBuilder.java:203)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONStringer.string(JSONStringer.java:354)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONStringer.key(JSONStringer.java:386)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONObject.writeTo(JSONObject.java:734)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONStringer.value(JSONStringer.java:246)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONObject.writeTo(JSONObject.java:734)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONStringer.value(JSONStringer.java:246)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONArray.writeTo(JSONArray.java:616)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONStringer.value(JSONStringer.java:242)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONObject.writeTo(JSONObject.java:734)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at org.json.JSONObject.toString(JSONObject.java:702)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at com.reyun.tracking.utils.c.a(Unknown Source:45)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at com.reyun.tracking.sdk.i.handleMessage(Unknown Source:39)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at android.os.Looper.loop(Looper.java:223)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7665)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
04-08 16:56:28.684 1689 1689 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
04-08 16:56:28.720 230 384 W ActivityTaskManager: Force finishing activity com.hypergryph.arknights/com.u8.sdk.U8UnityContext
```
目前大概4G内存的手机dalvik heap限制在192M,这个我没有改,几年前的手机大概都是这个值. 而arknights实际使用在239M,这会导致无法gc而触发OOM kill,变成闪退。 我的s22u手机的heaplimit是 256M,所以我手机没这个问题。
从log看,是鹰角使用的广告跟踪sdk也就是热云tracking分配不了。刚开始还怀疑这部分有内存泄漏。后来我调高 android内核的heaplimit从192M到384M,目前完美运行超过2小时,
排除内存泄漏。不过我之前都运行得好好的,这次出现问题,估计应该是因为鹰角更新了第三方广告跟踪sdk,那个reyun.tracking.sdk导致的,
实际应该也没有bug,只是逻辑写得烂而已,heap要求过高。我记得之前鹰角好像更新说配置要求,有写1G内存。这样看实际是有变动的。我打算用模拟器碎石刷些经验书跟龙门币。我怀疑官方故意搞这个bug卡那些模拟器
上来就是bug针对你我很难不怀疑你是在?