Re: outofmemoryexception



"tin" <tin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:89268474-E119-47E1-948A-BED5C9C7C95F@xxxxxxxxxxxxxxxx
hi, i have an exe that holds a very large Dictionary collection that would
takes about 2.5G in total. the machine has 4G RAM.

if i load the entire collection within an EXE, i would get
outofmemoryexception when it uses up to about 1.5G RAM. however, if i split
the collection into 2 seperate EXE, one can load up to 1.2G and another 1.3G
without any problems even if they both run at the sametime. the machine
still has about 500 MB RAM free afterward.

ideally, i like to have just one EXE to hold all 2.5G data ... is it
possible? any idea?

thanks!


32 bit Windows applications only have access to 2GB (or up to 3GB on /4GT RAM tuning enabled systems) user virtual address space, the process VAS is fragmented as a result of loading the modules (DLL's) into the address space. The result is that you won't ever find a contiguous area of memory larger than say ~1.5GB, when Windows Forms is loaded, you won't even find such an area.
Note also that it's not possible you had two Dictionaries of 1.2 and 1.3GB loaded at the same time, guess one of these was freed by the GC at the time the second was created.
Another thing to keep in mind is that .NET (the current versions on both 32 and 64 bit Windows) don't allow you to create objects larger than 2GB, so you will have to change your design.

Willy.

.



Relevant Pages

  • Re: Which new language to learn?
    ... Load the about box and it jumps ... >ram, just so I can type in a few lines of text, and if with that, ... >it can't handle CR/LF translation between UNIX and Windows text files ... Probably the ones who decided to move it from Unix ...
    (comp.programming)
  • Re: X performance
    ... The applications takes a bit longer to load ... I use 160MB swap space for linux. ... swap instead of RAM like in windows. ...
    (comp.os.linux.misc)
  • Re: Opinions on the best EXE compressor
    ... with out such AV monitoring, ... the exe file, from first byte to last byte, before it begins it's execution. ... > Windows doesn't need to load the entire EXE or DLL into memory. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Windows wont start up ever time, I have to reboot it several times.
    ... Try new RAM. ... > Ever since I had windows xp home edit. ... I keep haveing to reboot it. ... Then some some times it will try to load, and then stop, ...
    (microsoft.public.windowsxp.general)
  • Re: outofmemoryexception
    ... outofmemoryexception when it uses up to about 1.5G RAM. ... the collection into 2 seperate EXE, one can load up to 1.2G and another ...
    (microsoft.public.dotnet.framework.clr)