black
black

Reputation: 1263

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).

Upvotes: 4

Views: 19955

Answers (2)

Josef
Josef

Reputation: 11

The Diagnostic tool settings define Limit values for the use of resources. You should unckeck this option.

Upvotes: 1

Starl1ght
Starl1ght

Reputation: 4493

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.

Upvotes: 9

Related Questions