简体   繁体   中英

Windows 7 64, how do I use more than 2 GB in C++

I am using Sublime Text 2 to write / compile / run C++ code. However once the program uses ~2 GB memory, it quits. I have more than enough memory. How do I increase this limit?

Two options:

  • You need a 64-bit compiler. You can install one using this installer . Note you can also install a 32-bit compiler with the same installer.

  • For 32-bit applications: set a bit in the executable file that signals to Windows it can use up to 4GB of memory. To do this, add -Wl,--large-address-aware to you linker command. This will give you 3GB on 32-bit Windows, and 4GB on 64-bit Windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM