Hi, I am getting in out of memory exception while using system.drawing intensively in my windows service.
here is a part of my code:
FileStream fs = new FileStream(ImagePath, FileMode.Open, FileAccess.Read);
img = (Image)Image.FromStream(fs).Clone();
The exception is not only raised in this point, it is also raised in other points sometimes where it involves drawing, cropping, resizing, image copy
I am always disposing all the used objects.
I saw this article about the "Out of memory exception" in system.drawing here
and while it is very similar to my case it is different because my testing data is a repeated chain of 40 images, so if there is an issue in one of them it should appear quickly from the first cycle.
I saw the limitation mentioned here
it says that we should not use system.drawing on Win/Web services.
OK, I need to use it with a windows service for massive images processing, what are the alternatives if any?