out-of-memory

Using single StringBuilder - throws OutofmemeoryException

孤者浪人 提交于 2019-12-11 03:20:00
问题 do like the below code, to read each line and perform a concatenation based on an input list listValues. BufferedReader br = null; StringBuilder sb = new StringBuilder(""); InputStream in = new FileInputStream(new File(file)); br = new BufferedReader(new InputStreamReader(in), 102400); for (String input; (input= br.readLine()) != null;) { for (int i = 0; i < listValues.size(); i++) { sb.append(input.substring(1, 5)); } map.put(sb.toString(), someOtherValue); sb.delete(0, sb.length()); } Using

Memory issue when Reading HUGE csv file, STORE as Person objects, Write into multiple cleaner/smaller CSV files

有些话、适合烂在心里 提交于 2019-12-11 03:04:53
问题 I have two text files with comma delimited values. One is 150MB and the other is 370MB, so these guys have three million+ rows of data. One document holds information about, let's say soft drink preferences, and the next might have information about, let's say hair colors. Example soft drinks data file, though in the real file the UniqueNames are NOT in order, nor are the dates: "UniqueName","softDrinkBrand","year" "001","diet pepsi","2004" "001","diet coke","2006" "001","diet pepsi","2004"

Can wrapping akka actors in a class cause memory leaks?

核能气质少年 提交于 2019-12-11 02:59:33
问题 I have a fairly basic wrapper class around a scala akka actorRef. Basically the class has a field which is an actorRef and exposes a number of methods that "tell" specific messages to the actorRef. In this fashion I can adhere to a specify API and avoid exposing tells or message classes. I've experienced a memory leak in my program and I'm wondering if my wrapper around akka actors is causing the problem. I wrote this simulation below to test my theory. import akka.actor.{ActorSystem,

VB6 App Calling .NET DLL OutOfMemory Exception

最后都变了- 提交于 2019-12-11 02:57:17
问题 We have a VB6 app that calls out to a .NET DLL. Occasionally, after the VB6 app has been running for a long time and has called the .NET code a lot, the .NET side of things throws an OutOfMemory exception, even though there is plenty of memory available on the machine. The VB6 memory space is also no where near it's limit. Does the .NET side keep a separate memory pool? Or is it apart of the VB6 app's memory pool? If it is separate, is there a way to see how big it is? The only huge memory

How to avoid OutOfMemoryException while loading large chunks of data from a database?

假如想象 提交于 2019-12-11 02:43:41
问题 Say, we have a table with some large text field containg jpg-files' binary data. The task is to get those files from a database on disk. So, at first I decided to do the following: MyDataContext dc = new MyDataContext(); foreach(ImageTable t in dc.ImageTable.OrderBy(i=>i.Id)) { using (StreamWriter writer = new StreamWriter(new FileStream(string.Concat(t.Name,".jpg"), FileMode.CreateNew), Encoding.GetEncoding(1251))) { writer.Write(t.Data); writer.Close(); } } But as soon as the table had

OutOfMemoryError when loading large amount of data in Android

我与影子孤独终老i 提交于 2019-12-11 02:43:38
问题 I'm downloading a rather large file on the SD card of an Android device (~60MB). The download goes fine, but I need to pull this file in its entirety into memory. I know that's a huge chuck of memory for a smart phone, but I know my device has more than double that amount. Anyway, my actual problem is I get a OutOfMemoryError when reading the file into a byte array. Is there any way to increase the allocated memory for my application, or some way to "fake" reference the file yet keep the file

error after taking several pictures using the android camera

╄→гoц情女王★ 提交于 2019-12-11 01:59:18
问题 I have an activity A where I'm building my own camera.In this activity the camera is opened and when the use presses a button a picture is taken. This is done like this: Activity A: //this button needs to be pressed to take the photo public void onClick(View arg0) { mCamera.takePicture(null, mPictureCallback, mPictureCallback); } //the method that gets called Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() { public void onPictureTaken(byte[] imageData, Camera c) { if

How can a preallocated OutOfMemoryError truthfully implement Throwable.getStackTrace if thrown twice?

我与影子孤独终老i 提交于 2019-12-11 01:33:13
问题 This is a follow up question to What happens when there's insufficient memory to throw an OutOfMemoryError? My question is the following: If an OutOfMemoryError is preallocated (to avoid the situation of having insufficient memory for the OutOfMemoryError object) and the JVM has to throw this type of error two times or more, then how can the preallocated object truthfully implement the getStackTrace method? If the same object is reused, then one of the objects will most likely have an invalid

Possible to set a maximum of memory consumption on a powershell script in % or megabyte?

江枫思渺然 提交于 2019-12-11 00:35:16
问题 I sometimes have scripts which are eating up all the memory. Since I don't want to monitor them all the time or set cpu priority to low manually I am wondering if there is an option to give that specific script a value (maybe in mb) of memory. Does this option exist? 回答1: PowerShell doesn't provide any built-in way to control system resources like the memory used by a script. Windows does provide a way to limit system resources to groups of processes, you can learn more about that here: http:

file too large for eclipse

耗尽温柔 提交于 2019-12-11 00:26:00
问题 So... I was generating queries and then I pastes one particularly long one into eclipse, eclipse encountered a heap error and then crashed. I thought, no big deal, I can just go back in and delete a bunch, except for... every time I try to look at the file now eclipse will just crash. Either a heap error or a gc overhead limit error. I plan on just deleting this from outside eclipse, but I really want to know if there are any clever ways of attacking this problem. It's less than 14 megs, and