android 集成到项目中,使用内存不断增加,最后内存溢出崩溃

0 votes
asked Oct 19, 2017 by liuchao5year (120 points)
ode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                               java.lang.Throwable: Explicit termination method 'close' not called
                                                   at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                                   at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:179)
                                                   at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:168)
                                                   at android.content.res.AssetManager.openAssetFd(Native Method)
                                                   at android.content.res.AssetManager.openFd(AssetManager.java:361)
                                                   at cn.easyar.engine.VideoPlayer.prepare(VideoPlayer.java:49)
                                                   at cn.easyar.VideoPlayer.open(Native Method)
                                                   at com.kindergarten.msmk.ui.ar.ARVideo.openVideoFile(ARVideo.java:42)
                                                   at com.kindergarten.msmk.ui.ar.HelloAR.render(HelloAR.java:257)
                                                   at com.kindergarten.msmk.ui.ar.GLView$1.onDrawFrame(GLView.java:52)
                                                   at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1579)
                                                   at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1285)

1 Answer

0 votes
answered Oct 19, 2017 by albert52 (31,850 points)

Hi,

1.你用的那个版本的EasyAR SDK?

2.可能原因(我分析的)

(1)IO文件流没有关闭,造成内存泄露

(2)AssetManager加载或关闭文件处理时有问题(可能识别图处理上)

(3)数据库查询的Customer没有关闭

(4)开启StrictMode模式 

3.建议适用官方samples来集成.

Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...