简体   繁体   English

java.lang.OutOfMemoryError:位图大小超出VM预算&java.io.FileNotFoundException

[英]java.lang.OutOfMemoryError: bitmap size exceeds VM budget & java.io.FileNotFoundException

I have taken over some one else's project as they have left now, however because it isn't my code and i'm not experienced in java i keep getting various errors on my application. 我已经接管了其他人的项目,但是由于这不是我的代码,而且我对Java没有经验,所以我在应用程序中经常遇到各种错误。

The first error that i am recieving is as follows: 我收到的第一个错误如下:

java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321466/58441_T_ADDRESSES_57075_OT.jpg&Text=LET_AGREED java.io.FileNotFoundException: http : //images.ultrait.me/ImageProcessor.aspx?imageURL= 381/ Sales/ 321466/ 58441_T_ADDRESSES_57075_OT.jpg& Text= LET_AGREED

As you can see from clicking the link the message appears, this is reading this information from a feed(which i do not have access too). 从单击链接可以看到,出现消息,这是从feed中读取此信息(我也没有访问权限)。 However it will not display on the application for some unknown reason. 但是,由于某些未知原因,它不会显示在应用程序上。 (I would also like to point out the feed and images are working fine on the iPhone application) (我还要指出,提要和图像在iPhone应用程序上都可以正常工作)

The second error i am recieving is as follows: 我收到的第二个错误如下:

java.lang.OutOfMemoryError: bitmap size exceeds VM budget java.lang.OutOfMemoryError:位图大小超出VM预算

here is the code that the project is saying that it is erroring on : 这是项目说的错误代码:

 bm_images = new Bitmap[10];
        for(int i=0; i<10;++i)
            bm_images[i] = BitmapFactory.decodeResource(getResources(), R.drawable.downloading);

I have a simular application that already does what i want my current application to do and the code is practically similar. 我有一个模拟应用程序,它已经可以执行我希望当前应用程序执行的操作,并且代码实际上是相似的。 So i really have no ideas as i have been comparing both versions against one another. 所以我真的没有想法,因为我一直在将两个版本相互比较。

As i say i am not a java pro and i really am unsure of what is causing this, if any one needs any other information to maybe try and help i don't mind sending information, i would be grateful for any help that any one can give me. 正如我所说的,我不是一名Java专业人士,而且我真的不确定是什么原因造成的,如果有人需要任何其他信息来尝试并帮助我不介意发送信息,我将不胜感激任何一个人可以给我。

Thanks. 谢谢。

Be remember that, each and everytime when your Bitmap did its work then make it null and recycle like mBitmap=null and mBitmap.recycle() . 请记住,每当您的位图工作时,都将其设置为null并像mBitmap = nullmBitmap.recycle()那样进行回收。 It will clear your Bitmap and application will release that much memory, so your app will not throw an Exception. 它将清除您的位图,并且应用程序将释放大量内存,因此您的应用程序不会引发异常。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.OutOfMemoryError:位图大小超过VM预算 - java.lang.OutOfMemoryError: bitmap size exceeds VM budget java.lang.OutOfMemoryError:位图大小超过第二次运行应用程序时VM预算崩溃 - java.lang.OutOfMemoryError: bitmap size exceeds VM budget crashes on second time running app java.lang.OutOfMemoryError:位图大小超出了Swipey-Viewpager中的VM预算 - java.lang.OutOfMemoryError: bitmap size exceeds VM budget in Swipey-Viewpager java OutOfMemoryError:位图大小超出VM预算 - java OutOfMemoryError: bitmap size exceeds VM budget 如何避免java.lang.OutOfMemoryError:在使用大位图时,位图大小超过了android中的VM预算? - How can I avoid java.lang.OutOfMemoryError: bitmap size exceeds VM budget in android while using a large bitmap? 为什么进程在错误后运行-java.lang.OutOfMemoryError:请求的数组大小超出了VM限制? - Why the processes runs after error - java.lang.OutOfMemoryError: Requested array size exceeds VM limit? 使用iText:java.lang.OutOfMemoryError:请求的数组大小超过VM限制 - Using iText: java.lang.OutOfMemoryError: Requested array size exceeds VM limit 线程“主”中的异常java.lang.OutOfMemoryError:请求的数组大小超出了VM限制 - Exception in thread “main” java.lang.OutOfMemoryError: Requested array size exceeds VM limit ObjectOutputStream-对象超过1GB会导致java.lang.OutOfMemoryError:请求的数组大小超出VM限制 - ObjectOutputStream - Object exceeding 1GB causes java.lang.OutOfMemoryError: Requested array size exceeds VM limit 如何修复:java.lang.OutOfMemoryError:请求的数组大小超过 VM 限制,同时为项目运行 Junit - How to fix : java.lang.OutOfMemoryError: Requested array size exceeds VM limit, while running Junit for a project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM