OutOfMemoryException When Allocating Huge Objects That Use Lots ofRAM on 64-bit Machine

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • powwow

    OutOfMemoryException When Allocating Huge Objects That Use Lots ofRAM on 64-bit Machine

    I am running out of memory (OutOfMemoryExc eption) when I do something
    like this:

    Hashtable h = new Hashtable(10000 000);

    It doesn't seem to use all of the RAM on the machine. I have 4GB of
    RAM installed.

    I have a 64 bit OS (Windows Vista). I have 64 bit CPU. (Intel Quad
    Core). So no 32-bit restriction argument applies here.

    I am using Visual Express 2008 C#. Since it doesn't come with
    editbin.exe I had to download Visual Express 2008 C++ and use it's
    editbin.exe on my C# executable.

    I executed "editbin /LARGEADDRESSAWA RE program.exe" But when I run
    program.exe it runs out of memory when I know there is RAM not being
    used.

    WHAT GIVES? PLEASE HELP. I feel like I bought a 64-bit machine for
    nothing since the sole purpose was to allocate more memory than a 32-
    bit OS.
  • Willy Denoyette [MVP]

    #2
    Re: OutOfMemoryExce ption When Allocating Huge Objects That Use Lots of RAM on 64-bit Machine

    "powwow" <Jimmy.Winn@gma il.comwrote in message
    news:ad7efd98-b9fa-4ea2-81dd-a40155c265de@f6 3g2000hsf.googl egroups.com...
    >I am running out of memory (OutOfMemoryExc eption) when I do something
    like this:
    >
    Hashtable h = new Hashtable(10000 000);
    >
    It doesn't seem to use all of the RAM on the machine. I have 4GB of
    RAM installed.
    >
    I have a 64 bit OS (Windows Vista). I have 64 bit CPU. (Intel Quad
    Core). So no 32-bit restriction argument applies here.
    >
    I am using Visual Express 2008 C#. Since it doesn't come with
    editbin.exe I had to download Visual Express 2008 C++ and use it's
    editbin.exe on my C# executable.
    >
    I executed "editbin /LARGEADDRESSAWA RE program.exe" But when I run
    program.exe it runs out of memory when I know there is RAM not being
    used.
    >
    WHAT GIVES? PLEASE HELP. I feel like I bought a 64-bit machine for
    nothing since the sole purpose was to allocate more memory than a 32-
    bit OS.


    Are you sure about this?
    (10000000);

    This value should not be a problem, even on 32-bit it should be fine.
    Please post a complete sample that illustrates the issue.


    Willy.


    Comment

    • Jeroen Mostert

      #3
      Re: OutOfMemoryExce ption When Allocating Huge Objects That Use Lotsof RAM on 64-bit Machine

      Willy Denoyette [MVP] wrote:
      Oh, but this is something different, 60000000 means an Hashtable of
      about 2.000.000.000 bytes of contagious memory, which is about the
      maximum size of a single object on .NET (2GB).
      Good thing, too, before that memory starts to infect the rest. :-)

      Do you have an autocorrecting spell-checker, by any chance? I could see it
      making "contagious " out of anything that doesn't resemble "contiguous " enough.

      --
      J.

      Comment

      • Willy Denoyette [MVP]

        #4
        Re: OutOfMemoryExce ption When Allocating Huge Objects That Use Lots of RAM on 64-bit Machine

        "Jeroen Mostert" <jmostert@xs4al l.nlwrote in message
        news:47eacf7e$0 $14346$e4fe514c @news.xs4all.nl ...
        Willy Denoyette [MVP] wrote:
        >Oh, but this is something different, 60000000 means an Hashtable of
        >about 2.000.000.000 bytes of contagious memory, which is about the
        >maximum size of a single object on .NET (2GB).
        >
        Good thing, too, before that memory starts to infect the rest. :-)
        >
        Do you have an autocorrecting spell-checker, by any chance? I could see it
        making "contagious " out of anything that doesn't resemble "contiguous "
        enough.
        You (and I) don't want to see my auto-correcting spell-checker turned on
        :-), the result is some mix of Dutch , French and English.
        I think it's just time to get some sleep that's all.


        Willy.



        Comment

        Working...