即使在我离开应用程序一段时间后,我的 logcat 中也会出现这些警告。(虽然没有杀,只是按回来离开它。)
05-03 13:43:42.955 13047-13053/package W/art: Suspending all threads took: 7.873ms
05-03 13:44:32.458 13047-13053/package W/art: Suspending all threads took: 13.441ms
05-03 13:46:58.584 13047-13053/package W/art: Suspending all threads took: 34.462ms
05-03 13:47:00.574 13047-13053/package W/art: Suspending all threads took: 8.281ms
05-03 13:48:00.425 13047-13053/package W/art: Suspending all threads took: 25.929ms
05-03 13:48:16.019 13047-13053/package W/art: Suspending all threads took: 35.053ms
05-03 13:50:01.858 13047-13053/package W/art: Suspending all threads took: 16.160ms
05-03 13:50:17.975 13047-13053/package W/art: Suspending all threads took: 20.074ms
05-03 13:52:07.744 13047-13053/package W/art: Suspending all threads took: 19.814ms
05-03 13:53:17.668 13047-13053/package W/art: Suspending all threads took: 7.578ms
05-03 13:54:42.766 13047-13053/package W/art: Suspending all threads took: 11.316ms
05-03 13:56:19.314 13047-13053/package W/art: Suspending all threads took: 21.873ms
05-03 13:58:56.140 13047-13053/package W/art: Suspending all threads took: 7.860ms
05-03 14:00:12.084 13047-13053/package W/art: Suspending all threads took: 19.430ms
这些数字很严重,而且很多。
我看到了一些关于这个问题的问题,但没有一个问题与我的相似,我不能接受“除非你没有 OOM 或冻结问题,否则忽略它”如果这可能导致,我不能等到它碰巧做一些事情它。
我只需要知道导致这种情况的原因以及如何防止这种情况发生。
我使用 Retrofit 来完成我的网络服务请求。还有一个 ThreadPoolExecutor 在等待请求完成时从缓存中获取/更新/删除数据。我认为这些都不会导致这种情况。
感谢您提供有关这种情况的任何想法或一般信息,因为我没有发现有关此“暂停所有线程”警告的任何具体信息。