Re: Out of memory when loading an image file

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



FrankMeng wrote:
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
.



Relevant Pages

  • Re: Out of memory when loading an image file
    ... I have 512MB memory, but I set virtual memory to 5GB. ... While Michael made a good point about the misleading errors, if your TIFF ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Virtual memory
    ... You can configure virtual memory in windows xp and thereby improve the ... How to set performance options in Windows XP ... if you have background programs such as printing or disk ... It is also known as the paging file. ...
    (microsoft.public.windowsxp.perform_maintain)
  • [NT] NNTP Service in Windows Contains Memory Leak
    ... NNTP Service in Windows Contains Memory Leak ... An affected server could be restored to normal service by ...
    (Securiteam)
  • Re: Physical Memory
    ... These Windows services are started: ... Memory optimizers/defragers are nothing more than snake ... These optimizers work by making demands on the Windows Memory Manager ... The funny thing about all of this nonsense is that the snake oil memory ...
    (microsoft.public.windowsxp.general)
  • Re: How hard is socket programming?
    ... finds the page which still happens to be in memory and ... paged out on Windows 7 with 8.0 GB RAM. ... As far as I can tell FastCGI is good here ... one that has been established by long practice (the ...
    (microsoft.public.vc.mfc)