在华为Honor 7上抛出OutOfMemoryError [英] Throwing OutOfMemoryError on Huawei Honor 7

查看:74
本文介绍了在华为Honor 7上抛出OutOfMemoryError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们开发了一个应用程序,其中包含个人资料图片和背景图片(模糊的个人资料图片)以及其他内容的配置文件.在我的所有4款三星设备(S2,S3 mini,S4,S6)和Nexus 4上,该应用程序均可正常运行.但是在Huawei Honor 7上我收到以下消息:

we develop an app in that you have a profil with profile picture and background image (blurred profile image) and other stuff. On all my 4 Samsung devices (S2, S3 mini, S4, S6) and on the Nexus 4 the App runs without any problems. But on the Huawei Honor 7 I get this message:

OutOfMemoryError无法分配31806012字节分配,其中包含4194304可用字节和24MB直到OOM"

OutOfMemoryError "Failed to allocate a 31806012 byte allocation with 4194304 free bytes and 24MB until OOM"

清单中的选项largeHeap设置为true.是否有可能使该应用程序在此设备上运行?我认为堆大小太小.

The option largeHeap is set to true in the manifest. Is there any possibility to get the app to work on this device? I think the heap size is too small.

我知道有很多事情可以优化应用程序.例如,我可以在使用后将所有使用的图像设置为null.但是开始时并没有使用太多图像.我不知道为什么该应用程序尝试分配31MB内存,但设备仅提供4MB内存.

I know there are several things to optimize the App. For example I could set all used images to null after usage. But at the start there are not very much images that are used. I wonder why the App tries to allocate 31MB memory but the device only offers 4MB memory.

推荐答案

您可以关闭一些方法或图片来解决该问题.祝您好运,我想这是电话问题.

You can close some methods or pics to target the problem.Good luck, I guess it's the phone problem.

这篇关于在华为Honor 7上抛出OutOfMemoryError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆