Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Manage more than 1GB of memory

This thread is locked; no one can reply to it. rss feed Print
Manage more than 1GB of memory
alex glez
Member #16,757
October 2017

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
Member #3,861
September 2003
avatar

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.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

alex glez
Member #16,757
October 2017

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
Member #3,861
September 2003
avatar

You're welcome :-)

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

torhu
Member #2,727
September 2002
avatar

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
Member #16,660
April 2017
avatar

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.

🌈🌈🌈 🌟 BlackRook WebSite (Only valid from my installer) 🌟 C/C++ 🌟 GNU/Linux 🌟 IceCream/Cornet 🌟 🌈🌈🌈

Rm Beer for Emperor 2021! Rm Beer for Ruinous Slave Drained 2022! Rm Beer for Traveler From The Future Warning Not To Enter In 2023! Rm Beer are building a travel machine for Go Back from 2023! Rm Beer in an apocalyptic world burning hordes of Zombies in 2024!

Chris Katko
Member #1,881
January 2002
avatar

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.

-----sig:
β€œPrograms should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Go to: