Ashok G
Ashok G

Reputation: 41

Limit RAM Usage to a CPP application

I have 3 GB RAM. Is there a way to allocate only 512MB of RAM to a C++ application?

Else

Is there a way to reduce my RAM to 512MB for a while for testing purpose?

Thanks, Ashok

Upvotes: 3

Views: 581

Answers (1)

Reno
Reno

Reputation: 33792

Use SetProcessWorkingSetSize()

Sets the minimum and maximum working set sizes for the specified process.

Upvotes: 4

Related Questions