News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Is it possible to expand the heap dedicated to my program?

Started by Adriano, September 03, 2019, 12:30:31 AM

Previous topic - Next topic

Adriano

Hi, I have to work with huge data (in ther orther of billions int numbers) and I'm not able to dynamically allocate the arrays because it lacks memory. Is it possible to expand the heap using Code::Blocks (running on Win 8.1)? Case it is possible, how can I do that?

oBFusCATed

What mode are you building your app 32bit or 64bit? 32 bit apps are limited to 2gb or (3.5 in some special settings).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

sodev

If you are using a 64 bit OS even a 32 bit application can use the full 4 GB address range if you mark it as Large-Address-Aware https://docs.microsoft.com/en-us/cpp/build/reference/largeaddressaware-handle-large-addresses?view=vs-2019 (GCC also offers a switch for that). If thats not enough you have to compile your application in 64 bit to use all available RAM. And if you don't have enough RAM, you can't process your data in one chunk but have to divide it into smaller chunks.