By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,929 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,929 IT Pros & Developers. It's quick & easy.

Creating a 1 GB Byte Array (System.OutOfMemoryException)

P: n/a
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

Mar 23 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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

jw********@gmail.com ha scritto:
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


Mar 24 '06 #2

P: n/a
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

jw********@gmail.com wrote:
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


Mar 24 '06 #3

P: n/a
to**************@uniroma1.it wrote:
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.
Mar 24 '06 #4

P: n/a

<jw********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
I need to create a 1 GB Byte array in memory.


Why?

Mar 24 '06 #5

P: n/a
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 Gideon wrote: 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

Mar 24 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.