llx2015 2016-01-13 07:59 采纳率: 0%
浏览 2744
已采纳

android :Throwing OutOfMemoryError.

最近发现APP在部分三星类型手机上面出现了内存溢出的问题,时有时无,不知道哪里出了问题,哪位大神指点下。

 01-13 15:50:26.874: E/ViewRootImpl(3441): sendUserActionEvent() mView == null

01-13 15:50:27.064: E/art(3441): Throwing OutOfMemoryError "Failed to allocate a 6144012 byte allocation with 5750804 free bytes and 5MB until OOM"

01-13 15:50:27.064: E/Resources(3441): ExecutionException

01-13 15:50:27.064: E/Resources(3441): java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Failed to allocate a 6144012 byte allocation with 5750804 free bytes and 5MB until OOM

01-13 15:50:27.064: E/Resources(3441):  at java.util.concurrent.FutureTask.report(FutureTask.java:93)

01-13 15:50:27.064: E/Resources(3441):  at java.util.concurrent.FutureTask.get(FutureTask.java:163)

01-13 15:50:27.064: E/Resources(3441):  at android.content.res.Resources.getRCCachedDrawable(Resources.java:3625)

01-13 15:50:27.064: E/Resources(3441):  at android.content.res.Resources.loadDrawable(Resources.java:3532)

01-13 15:50:27.064: E/Resources(3441):  at android.content.res.TypedArray.getDrawable(TypedArray.java:762)

01-13 15:50:27.064: E/Resources(3441):  at android.view.View.<init>(View.java:3957)

01-13 15:50:27.064: E/Resources(3441):  at android.view.ViewGroup.<init>(ViewGroup.java:507)

01-13 15:50:27.064: E/Resources(3441):  at android.widget.LinearLayout.<init>(LinearLayout.java:199)

01-13 15:50:27.064: E/Resources(3441):  at android.widget.LinearLayout.<init>(LinearLayout.java:195)

01-13 15:50:27.064: E/Resources(3441):  at android.widget.LinearLayout.<init>(LinearLayout.java:191)

01-13 15:50:27.064: E/Resources(3441):  at java.lang.reflect.Constructor.newInstance(Native Method)

01-13 15:50:27.064: E/Resources(3441):  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)

01-13 15:50:27.064: E/Resources(3441):  at android.view.LayoutInflater.createView(LayoutInflater.java:614)

01-13 15:50:27.064: E/Resources(3441):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)

01-13 15:50:27.064: E/Resources(3441):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:689)

01-13 15:50:27.064: E/Resources(3441):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:748)

01-13 15:50:27.064: E/Resources(3441):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)

01-13 15:50:27.064: E/Resources(3441):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)

01-13 15:50:27.064: E/Resources(3441):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)

01-13 15:50:27.064: E/Resources(3441):  at android.view.LayoutInflater.inflate(LayoutInflater.java:511)

01-13 15:50:27.064: E/Resources(3441):  at android.view.LayoutInflater.inflate(LayoutInflater.java:415)

01-13 15:50:27.064: E/Resources(3441):  at android.view.LayoutInflater.inflate(LayoutInflater.java:366)

01-13 15:50:27.064: E/Resources(3441):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:428)

01-13 15:50:27.064: E/Resources(3441):  at android.app.Activity.setContentView(Activity.java:2267)

01-13 15:50:27.064: E/Resources(3441):  at ixz.fish_help_app.DevListActivity.onCreate(DevListActivity.java:188)

01-13 15:50:27.064: E/Resources(3441):  at android.app.Activity.performCreate(Activity.java:6288)

01-13 15:50:27.064: E/Resources(3441):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)

01-13 15:50:27.064: E/Resources(3441):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)

01-13 15:50:27.064: E/Resources(3441):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)

01-13 15:50:27.064: E/Resources(3441):  at android.app.ActivityThread.access$900(ActivityThread.java:177)

01-13 15:50:27.064: E/Resources(3441):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)

01-13 15:50:27.064: E/Resources(3441):  at android.os.Handler.dispatchMessage(Handler.java:102)

01-13 15:50:27.064: E/Resources(3441):  at android.os.Looper.loop(Looper.java:145)

01-13 15:50:27.064: E/Resources(3441):  at android.app.ActivityThread.main(ActivityThread.java:5942)

01-13 15:50:27.064: E/Resources(3441):  at java.lang.reflect.Method.invoke(Native Method)

01-13 15:50:27.064: E/Resources(3441):  at java.lang.reflect.Method.invoke(Method.java:372)

01-13 15:50:27.064: E/Resources(3441):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)

01-13 15:50:27.064: E/Resources(3441):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)

01-13 15:50:27.064: E/Resources(3441): Caused by: java.lang.OutOfMemoryError: Failed to allocate a 6144012 byte allocation with 5750804 free bytes and 5MB until OOM

01-13 15:50:27.064: E/Resources(3441):  at dalvik.system.VMRuntime.newNonMovableArray(Native Method)

01-13 15:50:27.064: E/Resources(3441):  at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)

01-13 15:50:27.064: E/Resources(3441):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:747)

01-13 15:50:27.064: E/Resources(3441):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:568)

01-13 15:50:27.064: E/Resources(3441):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1014)

01-13 15:50:27.064: E/Resources(3441):  at android.content.res.Resources$RCCallable.call(Resources.java:1168)

01-13 15:50:27.064: E/Resources(3441):  at android.content.res.Resources$RCCallable.call(Resources.java:1147)

01-13 15:50:27.064: E/Resources(3441):  at java.util.concurrent.FutureTask.run(FutureTask.java:237)

01-13 15:50:27.064: E/Resources(3441):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)

01-13 15:50:27.064: E/Resources(3441):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)

01-13 15:50:27.064: E/Resources(3441):  at java.lang.Thread.run(Thread.java:818)

报错位置

 super.onCreate(savedInstanceState);

        context = this;
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.activity_dev_list);   //在这行
        Thread.setDefaultUncaughtExceptionHandler(new MyUncaughtHandler());
        tmp_view = getWindow().getDecorView();


        dev_info = new dev_info(this);

  • 写回答

2条回答 默认 最新

  • llx2015 2016-01-14 02:51
    关注

    问题解决了。在开机动画中使用AnimationDrawable,在动画结束后忘记使用AnimationDrawable.stop();了导致内存溢出

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 删除虚拟显示器驱动 删除所有 Xorg 配置文件 删除显示器缓存文件 重启系统 可是依旧无法退出虚拟显示器
  • ¥15 vscode程序一直报同样的错,如何解决?
  • ¥15 关于使用unity中遇到的问题
  • ¥15 开放世界如何写线性关卡的用例(类似原神)
  • ¥15 关于并联谐振电磁感应加热
  • ¥15 this signal is connected to multiple drivers怎么解决
  • ¥60 请查询全国几个煤炭大省近十年的煤炭铁路及公路的货物周转量
  • ¥15 请帮我看看我这道c语言题到底漏了哪种情况吧!
  • ¥66 如何制作支付宝扫码跳转到发红包界面
  • ¥15 pnpm 下载element-plus