out-of-memory

XML Node to String Conversion for Large Sized XML

一世执手 提交于 2019-12-23 18:24:20
问题 Till now I was using DOMSource to transform the XML file into string, in my Android App. Here's my code : public String convertElementToString (Node element) throws TransformerConfigurationException, TransformerFactoryConfigurationError { Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //initialize StreamResult with File object to save to file StreamResult result = new StreamResult(new StringWriter());

Ruby: Prawn PDF out of memory when using the group method

妖精的绣舞 提交于 2019-12-23 18:05:24
问题 I have a large number of products I want to display in a pdf, with category headers. If a category doesn't fit on the current page I want to move it to the next. For this I'm using Prawn's group method. Product.all.group_by(&:category).each do |category, products| pdf.group do # Simplified the data a bit for this example pdf.text category pdf.table products.map{ |p| [p.title, p.price] } end end This works very well for small amounts of products, but when I add more than 100 or so it takes a

Is there a more efficient way to append lines from a large file to a numpy array? - MemoryError

天大地大妈咪最大 提交于 2019-12-23 17:45:11
问题 I'm trying to use this lda package to process a term-document matrix csv file with 39568 rows and 27519 columns containing counting/natural numbers only. Problem: I'm getting a MemoryError with my approach to read the file and store it to a numpy array. Goal: Get the numbers from the TDM csv file and convert it to numpy array so I can use the numpy array as input for the lda. with open("Results/TDM - Matrix Only.csv", 'r') as matrix_file: matrix = np.array([[int(value) for value in line.strip

Get OOM exception when sending message with a high speed with netty

浪子不回头ぞ 提交于 2019-12-23 17:22:34
问题 I write a client with netty in order to send message at a high rate. By jConsole I see "old gen" is increasing, and finally it throws java.lang.OutOfMemoryError: GC overhead limit exceeded. Are there some ways or configuration to avoid this exception The following is my test code: import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel

WP8 Memory leak opening and closing PhoneApplicationPage

假如想象 提交于 2019-12-23 16:41:53
问题 I'm creating a Windows phone application that shows a list of thumbnails. I'm using a LongListSelector to do it. My application has memory leaks when I navigate forward and backward to the thumbnails list some times. I review the memory usage while using the App and I see that the memory increases when opening the page with the thumbnails (as I expect to). When I navigate back to the previous page the memory usage decrease but not as much at it was increased. Repeating the proces several

How to read xml file having different hierarchy in .net

不问归期 提交于 2019-12-23 13:12:12
问题 I have big 7GB xml file ,and i am pasting small portion here <?xml version="1.0" encoding="UTF-8"?> <bulkFile xmlns:un="utranNrm.xsd" xmlns:es="Attributes.15.25.xsd" xmlns:xn="generic.xsd" xmlns:gn="geran.xsd" xmlns="configData.xsd"> <fileHeader fileFormatVersion="32.615 V4.5" Name="Wmart"/> <configData dnPrefix="Undefined"> <xn:SubNetwork id="M_ROOT"> <xn:VsDataContainer id="1"> <xn:attributes> <xn:vsDataType>vsDataAreas</xn:vsDataType> <xn:vsDataFormatVersion>SpecificAttributes</xn

SQL Cursor throws out of memory while calling getString

余生颓废 提交于 2019-12-23 12:56:26
问题 Attachment Reference to my earlier question :- Out of memory I would try to be as precise as possible. I am getting a response from my web-service call a long base64 string. I decode the string and get a huge string which contains my data. I de-serialize the string and create the object of my class using the string as below. String decryptedXml = XmlObject.toDecryptedXmlString(gameDetail.getGameData(), app.getSessionEncryptionKey()); Game noviceGame = deserialiseGame(decryptedXml, NoviceGamer

Efficient way to merge multiple large DataFrames

左心房为你撑大大i 提交于 2019-12-23 11:56:30
问题 Suppose I have 4 small DataFrames df1 , df2 , df3 and df4 import pandas as pd from functools import reduce import numpy as np df1 = pd.DataFrame([['a', 1, 10], ['a', 2, 20], ['b', 1, 4], ['c', 1, 2], ['e', 2, 10]]) df2 = pd.DataFrame([['a', 1, 15], ['a', 2, 20], ['c', 1, 2]]) df3 = pd.DataFrame([['d', 1, 10], ['e', 2, 20], ['f', 1, 1]]) df4 = pd.DataFrame([['d', 1, 10], ['e', 2, 20], ['f', 1, 15]]) df1.columns = ['name', 'id', 'price'] df2.columns = ['name', 'id', 'price'] df3.columns = [

Getting stack trace from Perl “Out of memory” error

ⅰ亾dé卋堺 提交于 2019-12-23 10:27:38
问题 tl;dr: How to dump a perl stack trace when a Perl httpd process runs out of memory. We've got a mod_perl 2 server, Perl 5.8.8, RHEL 5.6, Linux 2.6.18. Very occasionally and unpredictably, a child httpd process starts using up all available memory at an alarming rate. We've at least used BSD::Resource::setrlimit(RLIMIT_VMEM, ...), so that the process dies with "Out of memory" before bringing down the server. We don't know where in the code this is happening, and it's difficult to reproduce

java.lang.OutOfMemoryError Even in a try-catch block?

↘锁芯ラ 提交于 2019-12-23 10:08:48
问题 My application crashes, showing this in logcat: java.lang.OutOfMemoryError: (Heap Size=39047KB, Allocated=19932KB) at android.graphics.BitmapFactory.nativeDecodeFile(Native Method) at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:373) at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:443) at com.mApp.mobileapp.mActivity.onActivityResult(mActivity.java:196) at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:153) at android.app