out-of-memory

'OutOfMemoryException' reading 20mb XLSX file

浪尽此生 提交于 2019-12-13 16:22:38
问题 I'm using NPOI to deal with Excel files. Here's how I'm reading files: using (FileStream stream = File.OpenRead(excelFilePath)) { IWorkbook wb = WorkbookFactory.Create(stream); ... } However, for any XLSX file larger than a few megabytes, it causes memory usage to shot up to about 1GB and eventually throw an OOM exception. Doing some research, I've found out that, strangely, loading a workbook from a File rather than a Stream results in less memory consumption by POI. The closest C#

How to let the PSOldGen expand to accommodate very large objects?

心不动则不痛 提交于 2019-12-13 12:29:44
问题 I have a program which needs to allocate heap space for one very large object, but I'm finding that I get OutOfMemoryException s when there appears to be much more free heap than that large object should require. This test program demonstrates the problem: public class HeapTest { public static void main(String[] args) { final int size = Integer.parseInt(args[0]); System.out.println(size >> 20); final byte[] buf = new byte[size]; System.out.println(buf.length); } } If I run it as java -Xmx40M

OOM-killer with Java application on Linux

旧时模样 提交于 2019-12-13 11:50:36
问题 I have a problem with my Java application on a Linux system (version 2.6.39.2) with 500MB RAM. Every hour my application takes 1-2MB resident memory more. The application starts with 40MB of resident memory used. After 15 days, OOM-killer kills my application (see attached log). More information: I haven’t set any memory limit (no Xms, Xmx, …) for my application. I have made a heap dump when 396MB of resident memory where used but for Memory Analysis tool, I only use 7.8MB of memory and there

Memory allocation when loading a really large image on Android

走远了吗. 提交于 2019-12-13 09:10:14
问题 I need to figure out much memory I can allocate without having an OutOfMemoryError when loading a bitmap. I decided to load a really large image from a file. Here is its URL: https://upload.wikimedia.org/wikipedia/commons/3/3d/LARGE_elevation.jpg The image size is 14 488 498 bytes (14,5 MB on disk). And here is my code: public class MainActivity extends AppCompatActivity implements View.OnClickListener { private static final String LOG_TAG = "LargeBitmapLargeBitmap"; private ActivityManager

Android Java out of memory exception loading spritsheets

淺唱寂寞╮ 提交于 2019-12-13 07:53:48
问题 I want do make a virtual pet on a android device, but I got problems loading all the spritesheets (these are .png files). I can load a certain amount of sheets withouth crashing, but not all. Of course this is due to the lack of enough memory. The images are each less then 650 kB (each image has a resolution of roughly 200x6300) , so I guess i'm doing something horrible wrong. My question: "How to load all these images withouth crashing due to an Out of Memory Exception?" I load the images in

Memory error with dask array

ⅰ亾dé卋堺 提交于 2019-12-13 07:03:46
问题 I am implementing Neural Network whose input and output matrices are very large, so I am using dask arrays for storing them. X is input matrix of 32000 x 7500 and y is output matrix of same dimension. Below is neural network code having 1 hidden layer: class Neural_Network(object): def __init__(self,i,j,k): #define hyperparameters self.inputLayerSize = i self.outputLayerSize = j self.hiddenLayerSize = k #weights self.W1 = da.random.normal(0.5,0.5,size =(self.inputLayerSize,self

jquery infinite scroll plugin - loading and memory issues

一曲冷凌霜 提交于 2019-12-13 06:27:26
问题 I am using infinate scroll plugin (by Paul Irish). I want to use custom functions when the next page is loading and when the maxPage is reached. I have tried the below based on the documentation, however this starts the loading function but doesn't ever call the finished function. Its not calling the next page either when I look in the console. What am I missing? // Infinite Ajax Scroll configuration $container.infinitescroll({ navSelector: "div.paginate", nextSelector: "div.paginate a",

Drawing a series of UIImages and memory issues

女生的网名这么多〃 提交于 2019-12-13 06:22:29
问题 I need to draw a series of large UIImages on top of each other and I am coming up against memory issues and I was wondering if anybody has a solution. The code below gives you an example of how my function calls work. The functions have been simplified to show my main issue. The function "generateImage" has a for loop that calls into a subclass that also returns images that have been generated from a series of paths. I have put @autoreleasepools around the calls so that the images that are

Android take more picture from camera “Couldn't allocate byte array for JPEG data”

不想你离开。 提交于 2019-12-13 05:25:46
问题 I'm trying to take picture in sequence from Android, like a timelapse. I call camera.takePicture(null, null, jpegCallback); and my jpegCallback is: PictureCallback jpegCallback = new PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { time++; photoCounter.setText(String.valueOf(time)); SaveImageTask sav = new SaveImageTask(fileNameIND++); sav.execute(data); resetCam(); Log.d(TAG, "onPictureTaken - jpeg"); } }; private class SaveImageTask extends AsyncTask<byte[], Void

OutOfMemoryError crashes systemui when accessing Recent Apps only on Marshmallow

若如初见. 提交于 2019-12-13 05:25:12
问题 I'm working on an Android app that works well except when accessing the recent apps list on Android 6.0+. When I tap the recent apps button while my app is open, com.android.systemui will crash with the following stacktrace: 03-31 15:40:22.291 23442-23442/? E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback 03-31 15:40:22.318 23442-23442/? E/MessageQueue-JNI: java.lang.OutOfMemoryError: Failed to allocate a 119596108 byte allocation with 16777216 free bytes and 57MB