out-of-memory

C# Entity Framework 6: Out Of Memory when it absolutely should not run out of memory

落花浮王杯 提交于 2019-12-11 04:13:23
问题 I've simplified things as much as possible. This is reading from a table that has around 3,000,000 rows. I want to create a Dictionary from some concatenated fields of the data. Here's the code that, in my opinion, should never, ever throw an Out Of Memory Exception: public int StupidFunction() { var context = GetContext(); int skip = 0; int take = 100000; var batch = context.VarsHG19.OrderBy(v => v.Id).Skip(skip).Take(take); while (batch.Any()) { batch.ToList(); skip += take; batch = context

Android Out of Memory Error when loading images from resource

非 Y 不嫁゛ 提交于 2019-12-11 04:07:28
问题 I have a layout which I'm adding ImageViews (about 13) to at run time using a single thread. When I load more than 7 or 8 images (970px x 970px, 270kb) the application crashes displaying an out of memory error. Now when I load the same image rather than choosing 13 different images it displays fine. And also when I reduce the size of the images (16px x 16px, 770bytes) it displays fine. So does anyone know what the max memory allowed when loading images? What is the best way to get around this

How to get scaled bitmap with respect to screen size with out getting Out of memory exception

久未见 提交于 2019-12-11 04:02:52
问题 In my activity I am creating a Bitmap of the width and height same as the device resolution (width and height ) what I am doing Bitmap mBitmap = Bitmap.createBitmap(screenWidth, screenHeight, Bitmap.Config.ARGB_8888); and screenWidth and screenHeight is screenHeight = displaymetrics.heightPixels; screenWidth = displaymetrics.widthPixels; Now if I make this bitmap I get my heap goes up to 19mb , which is not so good. So tell me 2 things 1. What is a good way of creating the bitmap with respect

Why does my form throw an OutOfMemory exception while trying to load image?

别等时光非礼了梦想. 提交于 2019-12-11 03:51:19
问题 I have an application that saves User Information with Image into a data base. Admin can access the information those are already saved through a different form view. Clicking on the List Box item will display the details with Image retrieved from the database. UserViewDetails.cs: private void lbEmp_SelectedIndexChanged(object sender, EventArgs e) { try { if (lbEmp.SelectedIndex != -1) { em.Emp_ID = Convert.ToInt32(lbEmp.SelectedValue); em.SelectById(); if (!em.EmptyPhoto) pbEmp

Out of memory Error in picasso

心不动则不痛 提交于 2019-12-11 03:48:10
问题 I am using picasso library for loading multiple images on grid from server. I have three fragments on main activity.Each fragment loads multiple images on grid from server using picasso. when i navigate from fragment to fragment continously ,the fragments loads slow and then after half hour app get crash due to out of memory error in picasso. How to resolve it? public class MyAlbImageAdapter extends BaseAdapter { public List<MyAlbum> _albumList=AppController.getInstance().getPrefManger()

Ant with JUnit task - OutOfMemoryError

时光怂恿深爱的人放手 提交于 2019-12-11 03:47:23
问题 I have an interesting problem. I am using Ant which executes JUnit tests (test suite composed with 50 tests) via build.xml element. The problem is that I receive OutOfMemoryError. I have enlarged heap space using ANT_OPTS arguments but it did not help. When I execute the same test suite in Eclipse - everything is fine - memory is released thanks to GC. I think that this problem is related to Ant and its JUnit task. Maybe logging of the tests are the reason(but on the other hand I have

Why ThreadPoolExecutor behaves differently when running Java program in Eclipse and from command line?

青春壹個敷衍的年華 提交于 2019-12-11 03:46:27
问题 Can anybody explain why this code throws OOME when I run it from Eclipse (Juno) but works fine when I run it from command line? I use -Xmx256M in both cases. static class Task implements Runnable { byte[] buf = new byte[150000000]; @Override public void run() { } } public static void main(String[] args) throws Exception { System.out.println(Runtime.getRuntime().maxMemory()); ExecutorService ex = Executors.newSingleThreadExecutor(); ex.submit(new Task()).get(); ex.submit(new Task()).get(); }

RichTextBox throws OutOfMemory on Azure

南笙酒味 提交于 2019-12-11 03:46:23
问题 I'm using RichTextBox to convert a string in RTF to plain text, using this piece of code: private string ConvertToText(string rtf) { if (string.IsNullOrWhiteSpace(rtf)) return string.Empty; if (!rtf.Contains("{\\rtf")) return rtf.Trim(); using (var helper = new System.Windows.Forms.RichTextBox()) { helper.Rtf = rtf; var plainText = helper.Text; if (string.IsNullOrWhiteSpace(plainText)) return string.Empty; return "<< Rule in Rich Text Format converted to Plain Text >>\n\n" + plainText + "\n\n

Prevent OutOfMemoryException With AForge and Graphics.FromImage.DrawImage

不打扰是莪最后的温柔 提交于 2019-12-11 03:43:16
问题 I have written a code to allow the user to start and stop a feed from their webcam. I have used AForge.NET's NewFrameEventArgs to update a PictureBox with the new frame each time it changes. Everything works perfectly however whenever I start the feed, the RAM usage on my computer slowly goes up until an OutOfMemoryException occurs. Please could you help me find out how to clear or flush this somehow. When I get the exception, it occurs at the bottom of the code in ScaleImage: System.Drawing

while training with the opennlp training api command getting java heap space error:

戏子无情 提交于 2019-12-11 03:38:09
问题 I am using opennlp training api as shown below: Blockquote opennlp DoccatTrainer -model en-doccat.bin -lang en -data Task_notes_1new.train -encoding ISO-8859-1 Blockquote this api creates a model named en-doccat.bin from the training dataset Task_notes_1new.train. while training with the above command getting following error: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at opennlp.maxent.GISTrainer.trainModel(GISTrainer.java:301) at opennlp.maxent.GIS.trainModel(GIS