out-of-memory

How to reproduce Java OutOfMemoryError - GC overhead limit exceeded

不打扰是莪最后的温柔 提交于 2019-12-04 09:04:23
问题 My approach was to create hundred thousand local collections and populate them with random strings, something like this: SecureRandom random = new SecureRandom(); for(int i = 0 ; i < 100000 ; i++){ HashMap<String, String> map = new HashMap<String, String>(); for(int j = 0 ; j < 30 ; j++){ map.put(new BigInteger(130, random).toString(32), new BigInteger(130, random).toString(32)); } } I have provided -XX:+UseGCOverheadLimit jvm parameter too, but can not get the error. Is there any easy and

OutOfMemory when loading large Background Image

你离开我真会死。 提交于 2019-12-04 08:55:59
问题 I am using android:background to give a background image to android layout. After putting some images I get this exception : 08-24 00:40:19.237: E/dalvikvm-heap(8533): Out of memory on a 36000016-byte allocation. how can I use large images as backgrounds on android? can I expand the application heap memory? or is it something not good to do ? 回答1: Please have a look at my related question: High resolution Image - OutOfMemoryError Try to minimize the memory usage of your application by keeping

Validating a large XML file ~400MB in PHP

ぐ巨炮叔叔 提交于 2019-12-04 08:18:57
I have a large XML file (around 400MB) that I need to ensure is well-formed before I start processing it. First thing I tried was something similar to below, which is great as I can find out if XML is not well formed and which parts of XML are 'bad' $doc = simplexml_load_string($xmlstr); if (!$doc) { $errors = libxml_get_errors(); foreach ($errors as $error) { echo display_xml_error($error); } libxml_clear_errors(); } Also tried... $doc->load( $tempFileName, LIBXML_DTDLOAD|LIBXML_DTDVALID ) I tested this with a file of about 60MB, but anything a lot larger (~400MB) causes something which is

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

筅森魡賤 提交于 2019-12-04 08:09:54
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() .cacheInMemory() .cacheOnDisc() .imageScaleType(ImageScaleType.IN_SAMPLE_INT) .build(); this.imageLoader

PHPStorm/Webstorm increase memory to more than 512MB

六眼飞鱼酱① 提交于 2019-12-04 08:02:45
问题 I'm using PHPStorm under Win7 64bit with 64bit Java (latest version I guess) and working currently on an insanely big and chaotic project. There are many classes containing 10k LOC and more. Therefore my PHPStorm runs out of memory once in a while. I get this nice Out-of-Memory dialog suggesting increasing my memory settings. I currently have set in my PhpStorm.exe.vmoptions : -server -Xms128m -Xmx512m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=64m -ea -Dsun.io.useCanonCaches=false -Djava

Outofmemeoryerror (viewpager + imageviews)

血红的双手。 提交于 2019-12-04 07:47:55
问题 i am showing 150+ images in viewpager, when page size crossed 70 app is crashing , all images are loading from network , and i have fallowed [link]: Strange out of memory issue while loading an image to a Bitmap object and i am recycling it whenever page swiping reaches 4, for 70 page app taking 200 MB of memory. i need help from you, how to handle it i have to show all pages with swiping... i have also used Runtime.getRuntime().gc(); is any way to releasing memory if app memory is reaches

Out of Memory : android.support.v7.app.AppCompatActivity.onCreate

末鹿安然 提交于 2019-12-04 07:28:12
问题 we recently switched to using AppCompatActivity instead of FragmentActivity and now some devices are randomly crashing with the following error. No idea why this is happening. Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 16008012 byte allocation with 4277152 free bytes and 4MB until OOM at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java) at android.graphics.BitmapFactory.nativeDecodeAsset(BitmapFactory.java) at android.graphics.BitmapFactory.decodeStream

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

天涯浪子 提交于 2019-12-04 07:25:56
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 decode resource at the start of each activitiy, and refer to the bitmap at package level, would this

Memory optimized OrderBy and Take?

你。 提交于 2019-12-04 07:25:16
I have 9 GB of data, and I want only 10 rows. When I do: data.OrderBy(datum => datum.Column1) .Take(10) .ToArray(); I get an OutOfMemoryException . I would like to use an OrderByAndTake method, optimized for lower memory consumption. It's easy to write, but I guess someone already did. Where can I find it. Edit : It's Linq-to-objects. The data comes from a file. Each row can be discarded if its value for Column1 is smaller than the current list of 10 biggest values. I'm assuming you're doing this in Linq to Objects. You could do something like... var best = data .Aggregate(new List<T>(),

Why do files remain in project window after being closed?

你离开我真会死。 提交于 2019-12-04 07:22:07
问题 Scenario I have a userform, and when a button is pressed, it opens an Excel file as read-only, gets some values, and closes that file. Following are the codes I am using to open and close the file. To open: Set planbook = Workbooks.Open(planFilePath, ReadOnly:=True) To close: planbook.Close False Problem After closing the file, I see that file in the project window, for each time I press the button. It is using a lot of memory. Due to this, Excel hangs intermittently. Why are files opened