所以,我有一个安卓游戏,在画布上绘制东西。所以基本上,它一直循环着:
onDraw(Canvas c){
doThis();
doThat();
drawThis(c);
drawThat(c);
invalidate(); //calls onDraw again
}
除三星Galaxy S6 Edge外,它在任何设备上都能完美流畅地工作。我有一个自己,我的一个朋友在他的S6 Edge上经历了完全相同的事情。 (这个问题很可能也会发生在正常的S6上,因为它包含几乎相同的硬件,但我从未在该设备上运行该应用程序)。
问题:应用程序首先运行平稳,但运行几分钟后,它会永久冻结(或至少20分钟,然后我放弃),直到TouchWiz要求停止任务。 因此UI没有响应,它只是冻结,没有其他任何事情发生,但我现在能够在我的设备上捕获控制台输出:
W/Resources: Converting to string: TypedValue{t=0x12/d=0x0 a=3 r=0x7f0d003c}
W/Resources: Converting to string: TypedValue{t=0x12/d=0x0 a=3 r=0x7f0d003d}
D/Activity: performCreate Call Injection manager
I/InjectionManager: dispatchOnViewCreated > Target : com.dj.gravitydodge.FullscreenActivity isFragment :false
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
D/PhoneWindow: *FMB* isFloatingMenuEnabled return false
D/SRIB_DCS: log_dcs ThreadedRenderer::initialize entered!
D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so
I/OpenGLRenderer: Initialized EGL, version 1.4
I/OpenGLRenderer: HWUI protection enabled for context , &this =0x7f7ef05e60 ,&mEglDisplay = 1 , &mEglConfig = 2130264752
D/OpenGLRenderer: Get maximum texture size. GL_MAX_TEXTURE_SIZE is 8192
D/OpenGLRenderer: Enabling debug mode 0
D/mali_winsys: new_window_surface returns 0x3000, [2560x1440]-format:1
I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@33c468cf time:304260522
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
[... No output for a while ...]
I/art: Background sticky concurrent mark sweep GC freed 227691(7MB) AllocSpace objects, 0(0B) LOS objects, 10% free, 58MB/65MB, paused 622us total 113.736ms
[Freeze]
设备规格:
CPU: Samsung Exynos 7420 (4x1,5GHz & 4x2,1GHz) [Btw the only Octacore CPU, the app was tested on]
GPU: Mali-T760
RAM: 3GB DDR4
[More info: http://www.gsmarena.com/samsung_galaxy_s6-6849.php]
如果你知道问题的原因是什么,或者我如何解决它,请回答。 在此先感谢:)