out-of-memory

Android load image into imageview efficiently

允我心安 提交于 2019-12-02 09:34:59
问题 I have next problem: To avoid OutOfMemoryError i'm loading my big images into ImageViews using Picasso in such way: public static RequestCreator picasso(final Context context, final int resourceId) { return Picasso.with(context) .load(resourceId) .fit() .centerCrop() .noFade(); } And in activity or fragment, i'm loading image into ImageView final ImageView backgroundImage = (ImageView) root.findViewById(R.id.background_image); Util.picasso(getActivity(),R.drawable.background_soulmap) .into

java.lang.outofmemoryerror exception while trying to display images in gridview

馋奶兔 提交于 2019-12-02 09:30:46
I am trying to display 6 images, which i have kept in res/drawable folder in the gridview. but i get the following error 10-29 09:44:20.025: E/AndroidRuntime(1549): FATAL EXCEPTION: main 10-29 09:44:20.025: E/AndroidRuntime(1549): java.lang.OutOfMemoryError 10-29 09:44:20.025: E/AndroidRuntime(1549): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 10-29 09:44:20.025: E/AndroidRuntime(1549): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:501) 10-29 09:44:20.025: E/AndroidRuntime(1549): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory

MemoryError with Discord selfbot during 'bot.run'

陌路散爱 提交于 2019-12-02 08:57:30
问题 Before you tell me, yes I am aware that selfbots can get you banned. My selfbot is for work purposes in a server with me and three others. I'm doing nothing shady or weird over here. I'm using the following selfbot code: https://github.com/Supersebi3/Selfbot Upon logging in, being that I'm in about 50 servers, I experience the following: This carries on for several minutes, until I eventually get a MemoryError: File "main.py", line 96, in <module> bot.run(token, bot=False) File "D:\Python

Coverflow with Out of Memory

老子叫甜甜 提交于 2019-12-02 08:54:45
i am working on Windows 8 Phone Application. I have issue where i am loading image with text on top of the images one by one.Its called coverflow feature. I am getting Out of memory exception for (int j = 0; j < items.Count; j++) { for (int i = 0; i < items.Collection.Count; i++) { Myobj obj = items[j].Collection[i]; if (obj.correct == 1) { coverflow.Add(new CoverFlow(items[j].Text, answer.TextTwo)); } } } CarouselList.ItemsSource = coverflow; DataTemplate : <DataTemplate x:Key="DataTemplate1"> <Grid VerticalAlignment="Center" HorizontalAlignment="Center"> <Grid.RowDefinitions> <RowDefinition/

Out of Memory error using firebase

 ̄綄美尐妖づ 提交于 2019-12-02 08:18:07
问题 I am getting an oom error when reading from firebase database on android. I'm using fragments for tabs, this is the code for one of the tabs.. public class EventsTab extends Fragment { ListView listView; ArrayList<String> titles = new ArrayList<String>(); ArrayList<String> descriptions = new ArrayList<String>(); ArrayList<String> dates = new ArrayList<String>(); ArrayList<String> urls = new ArrayList<String>(); int counter = 0; float x1,x2; float y1, y2; static ProgressDialog dialog; static

Android loading images efficient (out of memory) [duplicate]

旧巷老猫 提交于 2019-12-02 07:46:31
This question already has an answer here: Bitmap recycle with largeHeap enabled 5 answers I just startet writing an app for Android. I have 3 activitys that use the same xml layout, an grid view. They also use all the same adapter to show an imageview and an textview in each grid item. When you select an object in the first activity, you get to the second and then to the third. First I used the normal method "imageView.setImageResource(drawableid)". It wasn't really a problem, but when I put more images into the gridview, I got the outofmemory error. So I search for a solution. I tried the

How to solve Java error “pool-1-thread-xxxx” java.lang.OutOfMemory

早过忘川 提交于 2019-12-02 07:46:30
I have searched the posts about this issue, but I did't see similar situation like mine. My java console shows the error message "pool-1-thread-xxxx" java.lang.OutOfMemory as the picture bellow: Red Line: CPU usage Green line: Memory usage I have increased the RAM from 6G to 10G , and set -Xms=8G -Xmx=8G -Xmn=3G in *.bat file before I start the program. I also keep watching performance monitor but the memory is always around 20%. I have no idea how could this happen. Any idea? Here is my run.bat code. @echo off javapro @java -Xoptimize -Xms8G -Xmx8G -Xmn3G -Xss1024k -XX:+UseConcMarkSweepGC -cp

Android HttpEntityUtils OutOfMemoryException

孤街醉人 提交于 2019-12-02 07:13:00
I'm working on a project which connect to a web server and receive binary data. My problem is when I'm downloading data from web server. If i send request to login or to activate some setting, there is no problem. But when I send request to download a binary data it's throwing me an OutOfMemoryException . Here is the code which I'm using : public byte[] activateColl(int index) { createCancelProgressDialog("","Communcating with you...","Cancel"); byte[] buffer = new byte[1024]; try { httpclient = new DefaultHttpClient(); httppost = new HttpPost("http://www.rpc.frbr.com"); TelephonyManager tm =

OutOfMemory when creating Base64 string in java?

好久不见. 提交于 2019-12-02 06:13:59
I used ostermillerutils library to create base64 string but I get OutOfMemory error if the image is heavy. If the image I try to convert is a simple image, the code is working fine. public String createBase64String(InputStream in) { //collect = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte[] buf = new byte[1024]; try { for(int readNum; (readNum = in.read(buf)) != -1; ) { bos.write(buf, 0, readNum); } } catch (IOException ex) { Logger.getInstance().debug("XML createBase64String: IOException"); return null; } finally { if (in != null) { try { in.close

Huge heap dump (11GB) - Jhat failed & Eclipse MAT needed help

二次信任 提交于 2019-12-02 06:09:27
We got a memory error in our EA and we used -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/path/to/some/dir to dump the heap at the time of OOM. We had a heap memory of 12GB and perm gen of 256MB. The heap dump is generated in the Linux box where we have our application running and its size is 11.5GB. We don't have privileges to download it to our local. When we tried to analyze that 11GB heap dump using JHAT it thrown an OOM. We tried the following commands from our Linux CLI. jhat java_pid1491.hprof jhat -J-Xmx16g -XX:-UseBiasedLocking java_pid1491.hprof jhat -J-d64 -J-Xmx16g -J-XX: