6106

Use the 3Gb of memory in 32 bits applications

Question:

I'm developing an application which import a lot of data, in some paralells thread.

Sometimes I got the OutOfMemoryException(when I use something like 1.5, 1.7GB of ram).

No big deal, I thought that I will make this a 64bit program(because it's not so huge). But because of a .Net bug(cannot have a primary key in decimal in 64 bits), I just cannot make a 64 bits program.( <a href="https://stackoverflow.com/questions/5480972/clr-detected-an-invalid-program-with-entity-framework" rel="nofollow">description of the problem</a> and I found many other case. And I just can't change anything in this database, not even a type or add a view).

I don't need a lot more than the 1.5-1-7GB of RAM. If only I can reach something like 2.5GB, I will be happy.

I read something about the "LARGEADDRESSAWARE", but I didn't find where to set it on my visual studio, and most of other tips where saying that I should modify the boot.ini file.

But since my computer is already a 64bits computers(with something like 8GB of ram), I don't think I've to do something here.

So what should I do to get access to those 3GB of ram?

Answer1:

Use editbin to set LARGEADDRESSAWARE flag like suggested in <a href="https://stackoverflow.com/questions/2597790/can-i-set-largeaddressaware-from-within-visual-studio" rel="nofollow">Can I set LARGEADDRESSAWARE from within Visual Studio?</a>.

editbin /largeaddressaware $(TargetPath)

You need to run x64 version of Windows or as you've mentioned for 32bit system change Boot.ini to allow apps use 3Gb of address space with <a href="http://msdn.microsoft.com/en-us/windows/hardware/gg487508.aspx" rel="nofollow">/3GB</a> switch.

Answer2:

A 32 bit application has 4GiB of virtual address space. If I remember correctly Windows by default split that into 2GiB for the application (including code, stack, data) and 2GiB for the system.

There should be a way to change that to 3 GiB for the application and 1 GiB for the system, but I do not think you can go beyond that in any case.

Recommend

  • update record in database using jdatabase
  • Cannot style mat-tab without ::ng-deep and !important
  • AlertDialog style when using setView()
  • DIV instruction jumping to random location?
  • How to detect interior vertices in groups of 2d polygons? (E.g. ZIP Codes to determine a territory)
  • C# program and C++ DLL compiled for 32-bit system crash on 64-bit system
  • Convert Type Decimal to Hex (string) in .NET 3.5
  • Z3: Convert between FP and BitVector?
  • How can the INSERT … ON CONFLICT (id) DO UPDATE… syntax be used with a sequence ID?
  • QLPreviewController hide print button in ios6
  • Why querying a date BC is changed to AD in Java?
  • Database structure design with variable amounts of fields
  • Why value captured by reference in lambda is broken? [duplicate]
  • Uncaught Error: Could not find module `ember-load-initializers`
  • How to extract text from Word files using C#?
  • How to check if every primary key value is being referenced as foreign key in another table
  • Sending data from AppleScript to FileMaker records
  • Join two tables and save into third-sql
  • Deserializing XML into class C#
  • How to model a transition system with SPIN
  • Statically linking a C++ library to a C# process using CLI or any other way
  • How to make Safari send if-modified-since header?
  • ORA-29908: missing primary invocation for ancillary operator
  • Calling of Constructors in a Java
  • How to pass list parameters for each object using Spring MVC?
  • Traverse Array and Display in markup
  • Transpose CSV data with awk (pivot transformation)
  • Buffer size for converting unsigned long to string
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • Why joiner is not used after Sequence generator or Update statergy
  • How do I configure my settings file to work with unit tests?
  • Setting background image for body element in xhtml (for different monitors and resolutions)
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • JaxB to read class hierarchy
  • Recursive/Hierarchical Query Using Postgres
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • Binding checkboxes to object values in AngularJs
  • UserPrincipal.Current returns apppool on IIS
  • Converting MP3 duration time