CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2010
    Posts
    23

    Out of memory exceptions in c# 4.0

    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.

  2. #2
    Join Date
    May 2012
    Location
    Bonn, Germany
    Posts
    43

    Re: Out of memory exceptions in c# 4.0

    Have you tried to track memory allocations?
    I actually don't know if this is possible at all in C#, but for C++ there are several tools/libraries that will record every memory allocation and show you later which ones have not been released.

    _________________________________
    Visit my project: Derivative Calculator

  3. #3
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Out of memory exceptions in c# 4.0

    If you liked my post go ahead and give me an upvote so that my epee.... ahem, reputation will grow.

    Yes; I have a blog too - http://the-angry-gorilla.com/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured