Manage more than 1GB of memory
alex glez

Regards. I have some questions related to ram memory and 1gb limit for 32bit applications like Allegro.
- Is it possible to compile my program with Allegro 5.2 in 64-bit visual studio to get more ram memory?
- or is there some other way to get more than 1gb of ram?

Thank you.

GullRaDriel

1 GB limit ? AFAIK It's a 4GB limit due to the addressing being a 32 bit int.

Allegro compiles without a problem on 64bit systems. It's even better that you can find prebuilt dev files and running libs in your favorite linux package manager.

If you do not want to switch to 64bit but still want more memory, it's possible and OS dependant. On windows it requires a boot flag to be set. Well. Better use 64bits imho.

alex glez

Greetings, thanks for responding. My knowledge is still limited.

After reading your comment, I tried to compile in x64 and correct the error when linking and it worked, I tried it in "beast mode" with 66 megapixel images and although it consumed 5 gb (after numerous processes) it did not fail.

Thanks, one less problem. a greeting

GullRaDriel

You're welcome :-)

torhu

I'm not sure you really want a game to consume more than 4 GB of RAM, though.

32-bit programs get up to 2 or 4 GB of memory on 64-bit Windows, depending on a linker setting:
https://docs.microsoft.com/en-us/cpp/build/reference/largeaddressaware-handle-large-addresses?view=vs-2019

You can also change this using the Editbin tool after building.

On 32-bit Windows, 2 GB is the maximum. Unless you want to require people to start Windows with a special flag in order to run your game...

RmBeer2

That is not possible, it is all work of the operating system, normally you can get more RAM using SWAP, although the performance drops greatly, especially if you are using memory continuously. You could design on your own a system that will keep continuous readings on disks, or some USB stick as extra memory, even if you also use their disk read.

There is really nothing magical like increasing RAM from scratch, the best thing you can do with RAM is first, choose the best operating system, I recommend a 32-bit Linux system, you could use it without problems with 1GB of RAM, second, 99% of that is dealt with in RAM is always data, that is, graphics, music, audios, etc., rather than worrying about the code you need to simplify this data to a minimum, the amount of tricks for this are too many.

Also, what you are asking is to compile from 32bit to 64bit, there is a lot of cross-compiler related information on the subject, if that is what you are looking for.

EDIT =================================

You really don't need as much memory to create games, with 1GB or 2GB is always enough, maybe it requires a little more for 3D games with almost HD textures.
You also don't need to test it for other systems except that your game is finished on your own system and you need to compile and correct some possible system or compiler bugs.

Chris Katko

Nitpicking:

I thought it was ~3.5 GB with ~.5 GB reserved for hardware addressing.

https://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/maximum-ram-for-windows-7-32-bit/4286bbfa-6851-e011-8dfc-68b599b31bf5

https://en.wikipedia.org/wiki/3_GB_barrier

But there's almost zero reason anyone should ever target 32-bit in 2020. The CPUs are extremely rare, and only incredibly old / unsupported APIs and libraries that you probably shouldn't be using are still running 32-bit. Even Raspberry Pi's have moved to 64-bit. So if you're targetting something that's worse than a $35 computer, something is probably wrong.

Thread #618147. Printed from Allegro.cc