Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I allocate more than 2GB of memory to a process in Windows?

I am running a program that builds a very large object, and I would greatly benefit from allocating more than 2GB of memory to this process. Thanks in advance.

like image 315
abw333 Avatar asked Jul 25 '11 16:07

abw333


People also ask

How do I allocate more RAM to a process?

Prioritize RAM UsageOpen Task Manager and right-click the application you want to prioritize, then select Go to details. This opens the Details tab of the Task Manager. Right-click the process and choose Set priority.

What is the max size of memory that can be allocated to a process?

The 2 GB limit refers to a physical memory barrier for a process running on a 32-bit operating system, which can only use a maximum of 2 GB of memory. The problem mainly affects 32-bit versions of operating systems like Microsoft Windows and Linux, although some variants of the latter can overcome this barrier.

How much memory can a single process use?

On 32-bit versions of Windows, a single process can map and address no more than 3GB of virtual memory at time. In 64-bit versions of Windows, a 32-bit process can map and address no more than 4GB of virtual memory at a time.

How much memory is allocated to a process in Windows?

Each process on 32-bit Microsoft Windows has its own virtual address space that enables addressing up to 4 gigabytes of memory. Each process on 64-bit Windows has a virtual address space of 8 terabytes.


2 Answers

You cannot allocate a single object (or an array) that is greater than 2GB, this is a CLR limitation. You'll have to split up the object into pieces.

like image 153
Ana Betts Avatar answered Nov 15 '22 07:11

Ana Betts


.NET Framework 4.5 allows creating arrays larger than 2GB on 64 bit platforms. This feature is not on by default, it has to be enabled via config file using the gcAllowVeryLargeObjects element.

http://msdn.microsoft.com/en-us/library/hh285054(v=vs.110).aspx

like image 20
Alina Popa Avatar answered Nov 15 '22 08:11

Alina Popa