out-of-memory

Android Universal Image Loader - how do I set the specs correctly?

别等时光非礼了梦想. 提交于 2019-12-06 03:17:10
问题 I have an app that loads a lot of big images remotely. When I use nostra's Universal Image Loader (https://github.com/nostra13/Android-Universal-Image-Loader) I often get Out Of Memory errors. I don't know how I should set up the imageloader to prevent this. This is my current ImageLoader specs: ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context) .enableLogging() .memoryCache(new WeakMemoryCache()) .build(); this.imgDispOpts = new DisplayImageOptions.Builder()

Android Camera Intent - Out Of Memory Error and Rotation Error

梦想与她 提交于 2019-12-06 03:14:30
I'm creating an android app that utilizes the camera to take pictures and then sends them to a server based on user input. I'm currently having some problems with the camera intent. My main problems are : Getting a picture that seems to be rotated when compared to the position it was taken. When I try to fix this Rotation I get an OutOfMemoryError So mainly I need to make sure that the orientation of the picture doesn't change and that I don't get an OutOfMemoryError. Here is the function that uses the camera Intent to take the picture. private void dispatchTakePictureIntent(int actionCode) {

Clojure Leining REPL OutOfMemoryError Java heap space

青春壹個敷衍的年華 提交于 2019-12-06 03:04:28
问题 I am trying to parse a fairly small (< 100MB) xml file with: (require '[clojure.data.xml :as xml] '[clojure.java.io :as io]) (xml/parse (io/reader "data/small-sample.xml")) and I am getting an error: OutOfMemoryError Java heap space clojure.lang.Numbers.byte_array (Numbers.java:1216) clojure.tools.nrepl.bencode/read-bytes (bencode.clj:101) clojure.tools.nrepl.bencode/read-netstring* (bencode.clj:153) clojure.tools.nrepl.bencode/read-token (bencode.clj:244) clojure.tools.nrepl.bencode/read

Java collection and memory optimization

被刻印的时光 ゝ 提交于 2019-12-06 02:55:37
I wrote a custom index to a custom table which uses 500MB of heap for 500k strings. Only 10% of the strings are unique; the rest are repeats. Every string is of length 4. How i can optimize my code? Should I use another collection? I tried to implement a custom string pool to save memory: public class StringPool { private static WeakHashMap<String, String> map = new WeakHashMap<>(); public static String getString(String str) { if (map.containsKey(str)) { return map.get(str); } else { map.put(str, str); return map.get(str); } } } private void buildIndex() { if (monitorModel.getMessageIndex() ==

Android: Out of Memory Exception / How does decodeResource add to the VM Budget?

点点圈 提交于 2019-12-06 02:47:51
问题 I am pretty new to Android and have been developing a game. Every now and again I have users reporting out of memory exceptions , which I find surprising since the bitmaps that I create are at most 200 kb in size. I call BitmapFactory.decodeResource() whenever I create a new sprite . Since my application is a zombie defense game, you could expect that I create sprites quite often. Every time I create a sprite, I call decode resource to generate a bitmap. My question is if I was to only call

Possible reasons for FileStream.Write() to throw an OutOfMemoryException?

☆樱花仙子☆ 提交于 2019-12-06 02:46:41
I have 10 threads writing thousands of small buffers (16-30 bytes each) to a huge file in random positions. Some of the threads throw OutOfMemoryException on FileStream.Write() opreation. What is causing the OutOfMemoryException ? What to look for? I'm using the FileStream like this (for every written item - this code runs from 10 different threads): using (FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite, BigBufferSizeInBytes, FileOptions.SequentialScan)) { ... fs.Write(); } I suspect that all the buffers allocated inside the FileStream don't

.NET System.OutOfMemoryException on String.Split() of 120 MB CSV file

纵饮孤独 提交于 2019-12-06 00:31:42
问题 I am using C# to read a ~120 MB plain-text CSV file. Initially I did the parsing by reading it line-by-line, but recently determined that reading the entire file contents into memory first was multiple times faster. The parsing is already quite slow because the CSV has commas embedded inside quotes, which means I have to use a regex split. This is the only one I have found that works reliably: string[] fields = Regex.Split(line, @",(?!(?<=(?:^|,)\s*\x22(?:[^\x22]|\x22\x22|\\\x22)*,) (?:[^\x22

C# OutOfMemoryException - How to track down the culprit

半城伤御伤魂 提交于 2019-12-06 00:24:37
I have a C#/WPF application that is meant to run on a small panel PC with 512 MB of memory. If it is left to run, an OutOfMemoryException is eventually thrown. This can take 12+ hours up to 2 days to happen. Using both ProcessExplorer and .NET Memory Profiler, I see no evidence that the memory used by my application is growing over time. There is just a typical pattern of a little growth followed by garbage collection. I've added code to print out all running processes and their memory information when the exception is thrown. I'm currently just waiting around for it to happen again. I should

Using Stanford CoreNLP - Java heap space

拟墨画扇 提交于 2019-12-05 23:47:54
问题 I am trying to use the coreference module of the Stanford CoreNLP pipeline, but I end up getting an OutOfMemory error in Java. I already increased the heap size (via Run->Run Configurations->VM Arguments in Eclipse) and set them to -Xmx3g -Xms1g. I even tried -Xmx12g -Xms4g, but that didn't help either. I'm using Eclipse Juno on OS X 10.8.5 with Java 1.6 on a 64-bit machine. Does anyone have an idea what else I could try? I'm using the example code from the website (http://nlp.stanford.edu

Why MetaSpace Size is twice as big as Used MetaSpace?

人走茶凉 提交于 2019-12-05 23:00:47
I wrote a program to simulate MetaSpace OOM. But I found that MetaSpace Size is almost always twice as big as Used MetaSpace . Why? I run my program with flag -XX:MaxMetaspaceSize=50m , the program throw OOM when Used MetaSpace reached about 25M rather than 50M, Why? expoter I think the following two experiment will explain what does the gap between MetaSpace Size and Used MetaSpace mean: EXP-1 : load one class per ClassLoader, I got this: EXP-2 : load five classes per ClassLoader, I got this: As Java 8 document says: Space is requested from the OS and then divided into chunks. A class loader