本文介绍了内存不足的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  Showing的OutOfMemoryError:位图的大小超过VM预算

我发展,应在手机和平​​板电脑上运行的应用程序。这两个图像是分开的,不同大小的。

I'm developing an app which should run on both phones and tablets. Images for both are separate and of different sizes.

应用程序崩溃说内存不足的异常。所以我的问题是,是不是因为平板电脑的图像尺寸这个错误发生?

The application is crashing saying out of memory exception. So my question is, is it because of the tablet image size this error happens?

如果我开发选项卡和手机两个独立的apk将这个问题整理出来?
和我有一些5器件是只显示一台设备上,而不是对他人的除外。

If i develop two separate .apk for tab and mobile will this problem be sorted out?And I have some 5 devices it's showing the exception on only one device and not on others.

推荐答案

在我看来,你是不是正确的你的记忆,和我想象中的内存硬件至少有天赋的机器之一,这杀死你。

It seems to me you are not properly managing your memory, and on one of the machines which I imagine is the least gifted in memory hardware, this kills you.

您应该profile您的application对于。

在你的问题是个人的角度来看,我认为这是最好有两个APK平板电脑和手机,和管理在您的code分支和构建脚本,但您的里程可能会有所不同。

On a personal standpoint about your question, I believe it's better to have two APK for tablets and phones, and manage that with branches in your code and build scripts, but your mileage may vary.

这篇关于内存不足的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 05:07