Pause GC Error post android 4.4.2 upgrade(android 4.4.2 升级后暂停 GC 错误)
问题描述
最近我的 Galaxy Note 2 升级到了 4.4.2 版本.我正在使用这款手机进行开发(使用 ADT),生活还不错,但发布此升级后Pause GC"错误开始出现,我无法解决.每当我的 ADT 工具 LogCat 中的 UI 屏幕更改状态时,它都会出现.下面是错误的转储.
Recently my Galaxy Note 2 was upgraded to version 4.4.2. I am using this phone for development (using ADT) and life was fine but post this upgrade "Pause GC" error started coming and I am unable to resolve. It comes every times UI screen change status in my ADT tool LogCat. Below is dump of the error.
提前感谢您的帮助.
05-13 22:39:22.538: W/dalvikvm(8350): No implementation found for native Ldalvik/system/VMRuntime;.pauseGc:(Ljava/lang/String;)I
05-13 22:39:22.543: E/MyThread(8350): Pause GC
05-13 22:39:22.543: E/MyThread(8350): java.lang.reflect.InvocationTargetException
05-13 22:39:22.543: E/MyThread(8350): at java.lang.reflect.Method.invokeNative(Native Method)
05-13 22:39:22.543: E/MyThread(8350): at java.lang.reflect.Method.invoke(Method.java:515)
05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.pauseGC(MyThread.java:5525)
05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.performLaunchActivity(MyThread.java:2324)
05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.handleLaunchActivity(MyThread.java:2471)
05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.access$900(MyThread.java:175)
05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread$H.handleMessage(MyThread.java:1308)
05-13 22:39:22.543: E/MyThread(8350): at android.os.Handler.dispatchMessage(Handler.java:102)
05-13 22:39:22.543: E/MyThread(8350): at android.os.Looper.loop(Looper.java:146)
05-13 22:39:22.543: E/MyThread(8350): at android.app.MyThread.main(MyThread.java:5602)
05-13 22:39:22.543: E/MyThread(8350): at java.lang.reflect.Method.invokeNative(Native Method)
05-13 22:39:22.543: E/MyThread(8350): at java.lang.reflect.Method.invoke(Method.java:515)
05-13 22:39:22.543: E/MyThread(8350): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
05-13 22:39:22.543: E/MyThread(8350): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
05-13 22:39:22.543: E/MyThread(8350): at dalvik.system.NativeStart.main(Native Method)
05-13 22:39:22.543: E/MyThread(8350): Caused by: java.lang.UnsatisfiedLinkError: Native method not found: dalvik.system.VMRuntime.pauseGc:(Ljava/lang/String;)I
05-13 22:39:22.543: E/MyThread(8350): at dalvik.system.VMRuntime.pauseGc(Native Method)
05-13 22:39:22.543: E/MyThread(8350): ... 15 more
更新:我已在 code.android.com (http://code.google.com/p/android/issues/detail?id=71073).根据他们的三星错误,所以我现在已经向三星论坛提出了这个问题.
UPDATE: I have initiated the issue at code.android.com (http://code.google.com/p/android/issues/detail?id=71073). As per them its Samsung bug so I have raised the issue to Samsung forum now.
推荐答案
在我的 Note 2 (GT-N7100), Android 4.4.2 上看到这个问题一段时间后,我想让我的上述评论成为一个正确的答案.
After seeing this issue for some time on my Note 2 (GT-N7100), Android 4.4.2 I wanted to make my above comment a proper answer.
按分配大小排序:
我在使用Android摄像头的时候使用webrtc来跟踪分配,可以清楚的看到每次调用摄像头,在新的Activity中将视频渲染到GLSurfaceView上,都会留下2MB多的垃圾, GC 永远不会收集到.
I used webrtc to track allocation when the Android camera is used, and it can be clearly seen that every time the camera is invoked and the video is rendered onto GLSurfaceView in a new Activity, more than 2 MB of trash is left over, which is never ever gathered by GC.
为了比较,以下是在 ASUS Memo Pad 2、Android 4.2.2 上跟踪的相同分配:
To compare, here is the same allocation tracked on an ASUS Memo Pad 2, Android 4.2.2:
按分配大小排序:
换句话说,在 Note 2 上,您可以在内存已满和设备崩溃之前启动视频实时取景大约 20-30 次.
In other words, on a Note 2 you can start a video live view about 20-30 times, before memory is full and the device crashes.
换句话说:三星去年通过更新引入了这个问题,但尚未修复它,他们也没有做出任何反应.三星是否想让我们购买新设备?好像是这样的.
In other words: Samsung introduced this issue with an update last year and did not yet fix it, nor do they react in any way. Does Samsung want to make us buy a new device? Looks like that.
--
这是我截至 2014 年 12 月 11 日的原始评论:
And here is my original comment as of 2014-12-11:
这确实会造成麻烦.它会导致设备占用更多内存比需要和崩溃.我们正在开发一个包含许多图像和视频,并且由于缺少 GC,因此可以使 Android 到达64MB 限制(注 2)和崩溃,而在其他设备上的内存消耗要低得多,并且内存总是在使用后释放.为了例如,具有相同分辨率的 ASUS 记事本会消耗大约12MB,三星 Note 2 需要 24MB.三星设备是不过,速度要快得多,这可能是因为省略了 GC.
It does cause trouble. It causes the device to take much more memory than needed and crash. We are developing an app with many images and videos, and due to the missing GC it is possible to make Android reach the 64MB limit (Note 2) and crash, whereas on other devices memory consumption is much lower and memory is always released after use. For example, an ASUS Memo Pad with the same resolution consumes about 12MB, for what the Samsung Note 2 takes 24MB. The Samsung device is much faster, though, probably because of the GC being omitted.
这篇关于android 4.4.2 升级后暂停 GC 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:android 4.4.2 升级后暂停 GC 错误
基础教程推荐
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01