Json.Net deserialize out of memory issue

To read large JSON string with use of JsonConvert.DeserializeObject will consume your lots of memory. So One of the ways to over come from this issue, you can create an instance of JsonSerializer as given below. using (StreamReader r = new StreamReader(filePath)) { using (JsonReader reader = new JsonTextReader(r)) { JsonSerializer serializer = new JsonSerializer(); … Read more

How to avoid OOM (Out of memory) error when retrieving all records from huge table?

With a little more information I can get a more helpful answer. If you are using MySQL: stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); stmt.setFetchSize(Integer.MIN_VALUE); from http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html: java.util.Properties info = new java.util.Properties(); info.put (“user”, “scott”); info.put (“password”,”tiger”); info.put (“defaultRowPrefetch”,”15″); getConnection (“jdbc:oracle:oci:@”,info);

Memory consumption of BitmapImage/Image control in Windows Phone 8

I was dealing with the same problem and I think, in the end, that actually I’ve found a workaround, I am not a pro programmer but here is my solution: public Task ReleaseSingleImageMemoryTask(MyImage myImage, object control) { Pivot myPivot = control as Pivot; Task t = Task.Factory.StartNew(() => { Deployment.Current.Dispatcher.BeginInvoke(() => { if (myImage.img.UriSource != … Read more

Out of memory exception while updating zip

The exact reason depends on a variety of factors, but most likely you are simply just adding too much to the archive. Try using the ZipArchiveMode.Create option instead, which writes the archive directly to disk without caching it in memory. If you are really trying to update an existing archive, you can still use ZipArchiveMode.Create. … Read more