Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / December 2006

Tip: Looking for answers? Try searching our database.

outofmemoryexception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tin - 18 Nov 2006 18:56 GMT
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!
Willy Denoyette [MVP] - 19 Nov 2006 13:24 GMT
> 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.
[quoted text clipped - 9 lines]
>
> 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.
tin - 19 Nov 2006 22:41 GMT
" 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. "

that's only when the 2 are in the same appl right?  i was loading them with
2 different exe.  and from the task manager, it's clear that one holds 1.2g
and one holds 1.3g.

so as long as i don't load a dictionary more than 1.5G within the same appl,
it should be ok right?

thank you very much.

> > 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.
[quoted text clipped - 22 lines]
>
> Willy.
Willy Denoyette [MVP] - 19 Nov 2006 23:28 GMT
>" Note also that it's not possible you had two Dictionaries of 1.2 and 1.3GB
> loaded at the
[quoted text clipped - 4 lines]
> 2 different exe.  and from the task manager, it's clear that one holds 1.2g
> and one holds 1.3g.

Yep, each process has 2GB VAS.
> so as long as i don't load a dictionary more than 1.5G within the same appl,
> it should be ok right?

Not necessarily,  suffice to load a third party DLL that is mapped somewhere in the middle
of the VAS to have your contiguous area further fragmented. On 32bit windows, you should
always be prepared to incur OOM exceptions when allocating such huge objects.

Willy.
tin - 20 Nov 2006 00:20 GMT
i see.   thanks for the quick and great info!

> >" Note also that it's not possible you had two Dictionaries of 1.2 and 1.3GB
> > loaded at the
[quoted text clipped - 14 lines]
>
> Willy.
Ben Voigt - 05 Dec 2006 23:03 GMT
> 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.
[quoted text clipped - 9 lines]
> ideally, i like to have just one EXE to hold all 2.5G data ... is it
> possible?  any idea?

search for "Address Windowing Extensions"

> thanks!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.