Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

Out of memory when loading an image file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
FrankMeng - 23 Sep 2007 03:46 GMT
When I tried to load 2GB tiff file, I got an "out of memory" error.
I have 512MB memory, but I set virtual memory to 5GB.
Is it possible to cut the big tiff file into several sub-images
without loading the whole image?
Michael A. Covington - 23 Sep 2007 05:55 GMT
I seem to recall that you get a misleading "out of memory" exception when
the format of the image file is wrong, so make sure you can load a smaller
image of the exact same type, and if not, look for other causes of the
problem.

> When I tried to load 2GB tiff file, I got an "out of memory" error.
> I have 512MB memory, but I set virtual memory to 5GB.
> Is it possible to cut the big tiff file into several sub-images
> without loading the whole image?
Peter Duniho - 23 Sep 2007 06:24 GMT
> When I tried to load 2GB tiff file, I got an "out of memory" error.
> I have 512MB memory, but I set virtual memory to 5GB.

While Michael made a good point about the misleading errors, if your
TIFF is actually 2GB it's not necessarily surprising that you would get
an "out of memory" error trying to load it.

For sure, there's no way you'd be able to load that under 32-bit
Windows.  If I recall correctly, even under 64-bit Windows, .NET is
still 32-bit though, and can't deal with objects larger than 2GB.

If your question hasn't been answered either by Michael's post or the
above, you should probably be more specific about the exact environment
you're using to attempt this.

> Is it possible to cut the big tiff file into several sub-images
> without loading the whole image?

Yes, but AFAIK there's nothing in .NET that would do this for you.
You'll have to parse the TIFF yourself and extract the specific data you
want for each sub-image.

Pete
Michael A. Covington - 23 Sep 2007 07:48 GMT
>> When I tried to load 2GB tiff file, I got an "out of memory" error.
>> I have 512MB memory, but I set virtual memory to 5GB.
>
> While Michael made a good point about the misleading errors, if your TIFF
> is actually 2GB it's not necessarily surprising that you would get an "out
> of memory" error trying to load it.

Also, 2 GB is an enormous TIFF.  Assuming it's 64 bits per pixel (16-bit
CMYK), that's still 16 megapixels.  What is the source of the image?
Arne Vajhøj - 23 Sep 2007 19:35 GMT
> For sure, there's no way you'd be able to load that under 32-bit
> Windows.  If I recall correctly, even under 64-bit Windows, .NET is
> still 32-bit though, and can't deal with objects larger than 2GB.

I think .NET is 64 bit as in that a reference is 64 bit and can
address in 64 bit space. There are just still a limit on maximum
object size.

Arne

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.