out-of-memory

Ruby paging over API response dataset causes memory spike

与世无争的帅哥 提交于 2020-01-06 04:42:09
问题 I'm experiencing an issue with a large memory spike when I page through a dataset returned by an API. The API is returning ~150k records, I'm requesting 10k records at a time and paging through 15 pages of data. The data is an array of hashes, each hash containing 25 keys with ~50-character string values. This process kills my 512mb Heroku dyno. I have a method used for paging an API response dataset. def all_pages value_key = 'values', &block response = {} values = [] current_page = 1 total

Android OutOfMemoryError with XML

冷暖自知 提交于 2020-01-05 10:10:24
问题 I'm building an app that fetches XML from a server, then parses it (it's DIDL formatted in places). The goal is to load as much into memory as possible to make it easier for users to browse (so as to enable fast scrolling through results), but I keep getting OutOfMemoryError s. I'm kind of new to Android, and it seems like the VMs are really finicky about things. I'm loading no more than a megabyte of XML, and pretty much discarding it right away. What should I do to prevent these errors from

java OutOfMemoryError: bitmap size exceeds VM budget

余生颓废 提交于 2020-01-05 07:02:13
问题 I have ImageView & one button on my ImageActivity. when the button is clicked the available images are listed, when one of them is clicked, it is loaded into the ImageView. imageView xml: <ImageView android:id="@+id/imageView" android:layout_width="300dip" android:layout_height="300dip" android:src="@android:drawable/alert_light_frame" /> Please see the code: public class ImageActivity extends Activity { private static final int SELECT_PICTURE = 1; private String selectedImagePath; private

Serialize/Deserialize Large DataSet

此生再无相见时 提交于 2020-01-05 04:15:33
问题 I have a reporting tool that sends query requests to a server. After the query is done by the server the result is sent back to the requesting reporting tool. The communication is done using WCF. The queried data, stored in a DataSet object, is very large and is usually round about 100mb big. To fasten the transmission I serialize (BinaryFormatter) and compress the DataSet.The transmitted object between the server and reporting tool is a byte array. However after a few requests the reporting

Android memory leak with ListView inside a Gallery

你说的曾经没有我的故事 提交于 2020-01-05 04:01:10
问题 I've been tracking down potential memory leaks in my Android application, and I've come across one that I'm not sure what to do with. First, I'll describe what I'm trying to do. For what it's worth, I'm building for Eclair (2.1, API level 7) and testing on an HTC Incredible running Gingerbread (2.3.7, API level 10). From observing LogCat, I assume my application has a maximum heap size of about 32MB. I am trying to build an address book wherein you have several pages of contacts. You navigate

Foreach through a large table using Yii ActiveRecord - “out of memory” errors

纵饮孤独 提交于 2020-01-05 04:00:51
问题 I have a website on Yii Framework and I want to search a table for matching words. I keep getting "out of memory" (it is a large table). I try this code but it keeps loading the page $dataProvider = new CActiveDataProvider('Data'); $iterator = new CDataProviderIterator($dataProvider); foreach($iterator as $data) { echo $data->name."\n"; } So I try this code but it keeps limiting the result to 10: $dataProvider = new CActiveDataProvider('Data'); $iterator = new CDataProviderIterator(

Java root cause java.lang.OutOfMemoryError error [duplicate]

試著忘記壹切 提交于 2020-01-05 02:04:24
问题 This question already has answers here : Closed 8 years ago . I am new to Java and given the task to fix a bug and the issue is as follows. It would be really great if you give suggestions/ideas what is this issue and how can I fix this.: HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache

Java root cause java.lang.OutOfMemoryError error [duplicate]

半城伤御伤魂 提交于 2020-01-05 02:03:12
问题 This question already has answers here : Closed 8 years ago . I am new to Java and given the task to fix a bug and the issue is as follows. It would be really great if you give suggestions/ideas what is this issue and how can I fix this.: HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache

c# richtextbox outofmemory

强颜欢笑 提交于 2020-01-04 14:28:21
问题 I have written an app that reads incoming chat(somewhat like an instant messenger), formats it and inserts it into a richtextbox. If you leave the program running long enough you will get an out of memory error. After looking at my code i think this is because i am never trimming the richtextbox. The problem that i'm running into is i don't want to call clear() because i don't want the visible text to disappear. I was thinking maybe i should keep a List with a max size of somthing like 200

How to remove only html tags from text with Jsoup?

我们两清 提交于 2020-01-04 11:00:36
问题 I want to remove ONLY html tags from text with JSOUP. I used solution from here (my previous question about JSOUP) But after some checkings I discovered that JSOUP gets JAVA heap exception: OutOfMemoryError for big htmls but not for all. For example, it fails on html 2Mb and 10000 lines. Code throws an exception in the last line (NOT on Jsoup.parse): public String StripHtml(String html){ html = html.replace("<", "<").replace(">", ">"); String[] tags = getAllStandardHtmlTags; Document thing =