Creating a 1 GB Byte Array (System.OutOfMemoryException)

J

jwgoerlich

Hello,

I need to create a 1 GB Byte array in memory. I can create it on a
Win2000 system. On a Win2003 system, the application throws a
System.OutOfMemoryException error. Both are running the latest .Net
Framework 2.0. Creating a 512 MB array works fine.

Any suggestions on what to check or change?

Thanks in advance,

J Wolfgang Goerlich
 
T

tommaso.gastaldi

Hi Wolfgang :)

why don't you also describe your general problem?

It is possible that strategies can be found (buffering, etc) and
perhaps here you would find some suggestions. In general, even if
possible, it does not seem a good idea to create objects of that size,
especially under windows... If possible, I would think twice about the
program architecture...

Anyway, how much memory is available on the respective the 2 machine
when you start creating the array, have you checked that value ?

-tom

(e-mail address removed) ha scritto:
 
B

Brian Gideon

Wolfgang,

Well, I guess you could put more memory in the machine. But, geez, a 1
GB byte array is huge. What do you plan on doing with it?

Brian
 
S

ShaneO

Hi Wolfgang :)

why don't you also describe your general problem?

In general, even if
possible, it does not seem a good idea to create objects of that size,
especially under windows... If possible, I would think twice about the
program architecture...

I'd certainly support Tom's suggestion. There must be a way to avoid
creating such an enormous array. I've never seen an instance where this
would be absolutely necessary - I'm not saying it can't happen, I'm
saying it's highly likely that another approach is available.

Please at least supply an overview of your application.

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
 
J

jwgoerlich

Tom write:
why don't you also describe your general problem?

Stress testing in preparation for a very memory and disk intensive
application. I need to stream as much data as possible from memory to
disk, as fast as possible. I am then doing the reverse, reading disk to
memory. All the while, I am timing and watching the utilization on
various levels.

Brian said:
Well, I guess you could put more memory in the machine.

My test machine is a aging but adequate. It is an IBM xSeries 350
server, with a 700 MHz Xeon processor and 4 GB of memory. I do not
think this is a hardware issue. As mentioned, I can create this array
when Win2000 is the OS, but not when Win2003 is (same VB.Net app, same
hardware).

Regards,

J Wolfgang Goerlich
 

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

Top