Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015: increase process memory

When I'm running my application in Visual Studio 2015, I see in the diagnostic tools that the process memory is stuck to 2GB - as if there was a limit:

Diagnostic

I read, that executing for x32 limits the available memory, so that it is necessary to use x64. So I build relase, x64 which gives me the result shown above. How can I remove this "limit"?

Note: I have 16GB Ram hardware (OS: Windows 10).

like image 352
black Avatar asked Dec 24 '22 20:12

black


1 Answers

There is no such limit, this is probably your code (or some library, that you use) uses exactly 2gb of ram.

If you try to allocate more than 2GB of memory in x86 application - you'll get std::bad_alloc exception, since OS is unable to provide more, despite, that you have 14GB more free memory.

Very simple program in MSVC2015 compiled as x64, like this:

for (int i = 0; i < 4000000; ++i) {
    char* ch = new char[1024];
}

eats 4gb of RAM, and no limit is imposed by default configuration.

like image 196
Starl1ght Avatar answered Dec 26 '22 09:12

Starl1ght