outofmemoryexception

Force garbage collection of arrays, C#

I have a problem where a couple 3 dimensional arrays allocate a huge amount of memory and the program sometimes needs to replace them with bigger/smaller ones and throws an OutOfMemoryException. Example: there are 5 allocated 96MB arrays (200x200x200, 12 bytes of data in each entry) and the program needs to replace them with 210x210x210...

Netbeans memory management

I have some Java code that is throwing out of memory exceptions after running for a while. I've investigated the netbeans profiler, and when I do one specific operation the Surviving Generations Metric goes up. However when I reset the program status (not kill it), the Surviving Generations Metric does not decrease. Why is the survivi...

Allocating more than 1,000 MB of memory in 32-bit .NET process

I am wondering why I'm not able to allocate more that 1,000 MB of memory in my 32-bit .NET process. The following mini application throws an OutOfMemoryException after having allocated 1,000 MB. Why 1,000 MB, and not say 1.8 GB? Is there a process-wide setting I could change? static void Main(string[] args) { ArrayList list = new Ar...

How to handle OUT OF MEMORY error for multiple threads in a Java Web Crawler

Hi! I'm fairly new to programming and am working for my dissertation on a web crawler. I've been provided by a web crawler but i found it to be too slow since it is single threaded. It took 30 mins to crawl 1000 webpages. I tried to create multiple threads for execution and with 20 threads simultaneously running the 1000 webpages took on...

SandCastle and OutOfMemoryException

SandCastle is unable to process our class library because it crashes with an OutOfMemoryException exception during XSL transformation. What can we do about that, except for the obvious, buy more memory? The problem is that this is our developer machines with 3.3GB memory on a 32-bit OS so basically we either have to upgrade to 64-bit an...

c# 'System.OutOfMemoryException' was thrown when there is still plenty of memory free

This is my code: int size = 100000000; double sizeInMegabytes = (size * 8.0) / 1024.0 / 1024.0; //762 mb double[] randomNumbers = new double[size]; Exception: Exception of type 'System.OutOfMemoryException' was thrown. I have 4GB memory on this machine 2.5GB is free when I start this running, there is clearly enough space on the PC t...

Memory shortage problem while using BufferedImage and ImageIO to save images.

I want to save some java.awt.Image objects into the disk. But when I try like: for (Image image : images) { image = new ImageIcon(image).getImage(); BufferedImage temp = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_RGB); Graphics2D g = temp.createGraphics(); g.drawImage(image, 0, ...

Resharper throws OutOfMemoryException on big solution

IDE Configuration: Visual Studio 2008 + Resharper 4.5.1 + Agent Smith 1.1.8. There is no any sophisticated configuration for last to add-ins. Solution description: 33 class libraries + web site with 200+ pages. Symptoms: After an hour of work under tuned on Resharper the IDE starts to throw the OutOfMemoryExection exceptions. Norma...

System.OutOfMemoryException importing Page with a single large DataGrid into Excel (Quick Fix)

We use Excel for a number of ad-hoc pivots / reports. To get the data into Excel we have a general page with a simple DataGrid that we bind from a DataSet / DataTable. We "Import External Data" using this URL in Excel. Unfortunately we have a query that returns around 100 columns and 40k rows. The Application server only has 2GB of RAM...

How to detect Out Of Memory condition?

I have an application running on Websphere Application Server 6.0 and it crashes nearly every day because of Out-Of-Memory. From verbose GC is certain there are the memory leaks(many of them) Unfortunately the application is provided by external vendor and getting things fixed is slow & painful process. As part of the process I need to...

Understanding .NET GC and OutOfMemory Exceptions

I'm troubleshooting an OutOfMemory exception in my .NET 2.0 Windows Service application. To understand the issue better I began by writing a simple .NET WinForm test app that generates an OOM Exception by building an ArrayList until an OOM Exception is thrown. The exception is caught and logged and I can click on a form button to run t...

.NET System.OutOfMemoryException and AppDomains

Hi, I have a plugin manager that launches a plugin which connects to a FoxPro database through the ADO.NET OLE DB provider. At one client site connections are opened and closed without any problems but at another client site, it gets stuck in 'connection.Open();' and within a couple of seconds over 1GB of memory is allocated. With...

C# string.split() "Out of memory exception" when reading tab separated file

I am using string.split() in my C# code for reading tab separated file. I am facing "OutOfMemory exception" as mentioned below in code sample. Here I would like to know why problem is coming for file having size 16 MB? This is right approach or not? using (StreamReader reader = new StreamReader(_path)) { //...........Load the firs...

Opening a simple OleDB connection throws OutOfMemory Exception?

Hi, I am having troubles with one of our applications. It's .NET 3.5 32 bits process. Upon startup we open a .mdb to read a few "metadata" values. This works on hundreds of systems, but we have a customer with a TabletPC and problems. The operating system is Windows XP Tablet PC SP3, 32 bits, bla bla. Nothing unusual. It has .NET 3.5 (f...

Eclipse's .ini settings don't seem to be helping me change the max heap size

Here is my eclipse.ini file: -startup plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519 -product org.eclipse.epp.package.java.product --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -vmargs -Dos...

Troubleshooting ERROR_NOT_ENOUGH_MEMORY

Our application is failing on one specific user's computer with ERROR_NOT_ENOUGH_MEMORY ("Not enough storage is available to process this command"). The error is apparently being raised somewhere deep within the Delphi VCL framework that we're using, so I'm not sure which Windows API function is responsible. Is memory a problem? A cal...

pls help to convert .bmp image to pixel data

pls help to convert .bmp image to pixel data Bitmap.FromFile(XYZ.bmp) gives System.OutOfMemoryException thank you ...

OutOfMemory, but no gcroots for many objects

We are developing a rather large Windows Forms application. In several customers' computers it often crashes with OutOfMemory exception. After obtaining full memory dump of the application moments after the exception (clrdump invoked from UnhandledException handler) I analyzed it with ".NET Memory Profiler" and windbg. The Memory Profil...

CComBSTR memory allocation

I have a "const char* str" with a very long string. I need to pass it from a cpp client to a .Net COM method which expects BSTR type. Currently I use: CComBSTR bstr = str; This has the following issues: Sometimes this line fails with out of memory message When I pass the bstr to the COM class it takes a lot of memory (much more than...

System.OutOfMemoryException on WCF Web Service

I struggle on a System.OutOfMemoryException when performing an import process where a lot of objects are being created. The effect is that the ASPNET_WP.EXE blows up to 1.4 GB and the exception will be thrown. I already tried to implement IDisposable and calling the Garbage Collector (GC.Collect()) in that responsible functions, but no...