Maximum Size of Byte Array

  • Thread starter Thread starter Gerrit
  • Start date Start date
|
| Setting Up a Windows XP 64 works really better with large images! I was
| able to load a a 400 MB tif File into memory (on my 1GB RAM, 2800+ AMD
| PC).
|

Really better?? running X64 on a 1GB system is not a real solution either,
sure you have a larger virtual address space, but you don't have the
necessary RAM to accomodate the memory you are allocating, that means that
you will suffer from extreme paging. Moving to 64 bit systems makes little
sense unless you have at least 4GB of RAM.


Willy.

| Gerrit schrieb:
|
| > Ok I will use a service for the conversation in future, that's clear
| > now.
| >
| >
| > Its for an image management application. You can (or should be able to)
| > upload and download images up to 1GB in size (as spezified by the
| > customer). Supported filetypes should be every "usual" type you know
| > (therefore saving jpeg as bitmap is only a small part of all conversion
| > problems I'm running into. what is with png, Tiff, etc...they all can
| > be compressed)
| >
| > Ok, Images > 500MB are very uncommon even in my case, and when somebody
| > wants to upload such an image, only bitmaps and tiffs would be
| > allowed.(By the way: does anybody know a way to determine filetype and
| > size BEFORE uploading?)
| >
| > I've found a C++ dll which I would like to give a try to. Its called
| > FreeImage
| > http://freeimage.sourceforge.net/
| >
| > Another thing would be to setup a Windows XP 64 Bit OS this
| > weekend...perhaps this helps too...
| >
| > --
| > Gerrit Horeis
| >
| > Software Developer
| > CI-Gate Development & Consulting GmbH
| > http://www.ci-gate.de
| > http://www.xira.de
| > http://www.bitbauer.de
| >
| >
| > Ignacio Machin ( .NET/ C# MVP ) schrieb:
| >
| > > Hi,
| > >
| > > It's been a while since I last saw the jpeg compression algorith but
I'm
| > > almost sure you can do it, it won't be efficient though. you would
have to
| > > discard parts of the image as you move forward (maybe saving chunk of
it)
| > >
| > > Again, 1 GB image is BIG, how many memory do you have to start with?
And if
| > > it's 1 GB in jpeg it would be mucho bigger in BMP !!!
| > >
| > > And finally this is not task for a asp.net app at all.
| > >
| > >
| > > What do you want to do with these images in the first place?
| > >
| > >
| > > --
| > > --
| > > Ignacio Machin,
| > > ignacio.machin AT dot.state.fl.us
| > > Florida Department Of Transportation
| > >
| > >
| > > | > > > But I'm not able to handle a jpeg image (for example) in parts. If I
| > > > would do so, I would have load the whole image into memory to get
parts
| > > > of it (because of compression)
| > > >
| > > > I've decided to take a look on DirectX. Perhaps it has a method that
| > > > can handle jpeg images. If I use unmanaged code, I would have to
write
| > > > the jpeg decompression algorithm on my own :-( This would be too
hard
| > > > for me and too time intensive...
| > > >
| > > > Thanks for all your help!
| > > >
| > > > --
| > > > Gerrit Horeis
| > > >
| > > > Software Developer
| > > > CI-Gate Development & Consulting GmbH
| > > > http://www.ci-gate.de
| > > > http://www.xira.de
| > > > http://www.bitbauer.de
| > > >
| > > > Ignacio Machin ( .NET/ C# MVP ) schrieb:
| > > >
| > > >> Hi,
| > > >>
| > > >> You will not be able to handle such a big image in memory. You
would have
| > > >> to
| > > >> devise a way to use it in parts.
| > > >> Also select carefully your tools, I don't think System.Drawing can
handle
| > > >> such a big image, you would be better using DirectX or even better
image
| > > >> manipulation code written in unmanaged code.
| > > >>
| > > >>
| > > >> --
| > > >> --
| > > >> Ignacio Machin,
| > > >> ignacio.machin AT dot.state.fl.us
| > > >> Florida Department Of Transportation
| > > >>
| > > >> | > > >> > Hi Jon,
| > > >> >
| > > >> > yes this pictures are really up to 1GB. My method to shrink the
images
| > > >> > works fine until a (decompressed) FileSize of 350 MB is reached.
| > > >> >
| > > >> > If I do it in pieces, I also need to decompress the Picture on
harddisk
| > > >> > as a bmp file and then read it into memory in small pieces. But
to
| > > >> > decompress such a large picture with an .Net service or something
i
| > > >> > will have to load it into memory anyway, which would cause a OOM
| > > >> > exception.
| > > >> >
| > > >> > Do I have to use unmanaged code? Or is there a Windows API or
anything
| > > >> > else I could use?
| > > >> >
| > > >> > --
| > > >> > Gerrit Horeis
| > > >> >
| > > >> > Software Developer
| > > >> > CI-Gate Development & Consulting GmbH
| > > >> > http://www.ci-gate.de
| > > >> > http://www.xira.de
| > > >> > http://www.bitbauer.de
| > > >> >
| > > >> >
| > > >> > Jon schrieb:
| > > >> >
| > > >> >> > I want to upload an image to a web application and therefore i
need
| > > >> >> > to
| > > >> >> > allocate this memory to fill the byte array with image data.
Then I
| > > >> >> > need to do a resizing operation.
| > > >> >>
| > > >> >> Is your image really 420MB large? That's really pretty massive.
Can
| > > >> >> you
| > > >> >> not do it in pieces? If not, perhaps you could launch a
different
| > > >> >> process to do the loading and resizing. That process could write
the
| > > >> >> result to disk, and then you could stream it to the web
application.
| > > >> >>
| > > >> >> --
| > > >> >> Jon Skeet - <[email protected]>
| > > >> >> http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
| > > >> >> If replying to the group, please do not mail me too
| > > >> >
| > > >
|
 
Willy said:
Really better?? running X64 on a 1GB system is not a real solution either,
sure you have a larger virtual address space, but you don't have the
necessary RAM to accomodate the memory you are allocating, that means that
you will suffer from extreme paging. Moving to 64 bit systems makes little
sense unless you have at least 4GB of RAM.

Sometimes just being able to do it is enough even though
performance is not good.

In some special cases it is possible to use the 64 bit
memory with much less RAM efficiently.

Arne
 
Arne Vajhøj said:
Sometimes just being able to do it is enough even though
performance is not good.

In some special cases it is possible to use the 64 bit
memory with much less RAM efficiently.

Agreed!

One classic example of this (ironically, since there's another off-topic
long thread here about this very thing) is memory mapped files. The file
system supports files larger than the 32-bit OS can map at once. The 64-bit
OS can simply map a whole file into the virtual address space, even if
larger than what the 32-bit OS can map. Physical RAM usage can be quite
low.

Likewise a very large array. Yes, page file usage will be quite large, but
then one ought to expect that on a 64-bit OS (and have enough hard disk
space to support it). As long as usage of the array is "friendly" (doesn't
try to access the whole thing all at once over and over again), swapping
need not be excessive, even if physical RAM is only 1GB.

What causes swapping is access of a large amount of data over a short period
of time. This can happen with or without 64-bit addressing, and 64-bit
addressing can happen with or without this kind of access.

Using 32-bit addressing made plenty of sense even when we only had 32MB of
RAM...I see no reason 64-bit addressing can't be useful when one has only
1GB of RAM.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top