learner learner

learner learner

  • NA
  • 29
  • 154.1k

Out of memory exceptions in c# 4.0

Apr 23 2012 10:23 AM

For some days I have been trying to optimize an image processing program (cropping, rotate, changing brightness and undo) written in c# 4.0. Getting suggestions from google I have optimized the code in many ways. At first some disposable objects hadn't been disposed that's why exception was shown. But I have tried to dispose all disposable objects. Still the program is showing out of memory exceptions. That's why I have uploaded the program for better solutions. Please download from the link

http://www.box.com/s/8eab0f3669ec4d79e3fc

My machine configuration: Core 2 Duo, 2 GB RAM, Windows XP service pack 3

Follow the steps:

Run the program

Load multiple images (at least 6) (each image is 3.5 MB or greater)

Double click on an image, crop (right click) and save. Do the same operation for other images. See what happens. It will show out of memory exceptions.

If any other operations (e.g. changing brightness) is done repeatedly (again and again) then it also shows out of memory exception.

I am eagerly waiting for your reply.


Answers (1)