Creating a 1 GB Byte Array (System.OutOfMemoryException)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jwgoerlich@gmail.com

    #1

    Creating a 1 GB Byte Array (System.OutOfMemoryException)

    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.OutOfMem oryException 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

  • tommaso.gastaldi@uniroma1.it

    #2
    Re: Creating a 1 GB Byte Array (System.OutOfMe moryException)

    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

    jwgoerlich@gmai l.com ha scritto:
    [color=blue]
    > 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.OutOfMem oryException 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[/color]

    Comment

    • Brian Gideon

      #3
      Re: Creating a 1 GB Byte Array (System.OutOfMe moryException)

      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

      jwgoerlich@gmai l.com wrote:[color=blue]
      > 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.OutOfMem oryException 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[/color]

      Comment

      • ShaneO

        #4
        Re: Creating a 1 GB Byte Array (System.OutOfMe moryException)

        tommaso.gastald i@uniroma1.it wrote:[color=blue]
        > 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...
        >[/color]

        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.

        Comment

        • Homer J Simpson

          #5
          Re: Creating a 1 GB Byte Array (System.OutOfMe moryException)


          <jwgoerlich@gma il.com> wrote in message
          news:1143150545 .423364.287810@ i40g2000cwc.goo glegroups.com.. .
          [color=blue]
          > I need to create a 1 GB Byte array in memory.[/color]

          Why?



          Comment

          • jwgoerlich@gmail.com

            #6
            Re: Creating a 1 GB Byte Array (System.OutOfMe moryException)

            Tom write:[color=blue]
            > why don't you also describe your general problem?[/color]

            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:[color=blue]
            > Well, I guess you could put more memory in the machine.[/color]

            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

            Comment

            Working...