1

Our program is acting weird. Using Delphi 11, we are building a program where the target platform is 64 bit. Every setting we have checked would point to a 64 bit result. However, when we run the program, and start to eat up some memory with large collections, etc. we get Out of Memory errors once we reach around 4G of memory allocated just like a 32 bit program would do.

Question is... Is there IDE setting at design time that would quietly revert the final product back to a 32 bit version? Would a third party component somehow change it? Are there compiler directives that could be hidden in our old code that could revert the build? We are at a loss to why our program is acting this way. Just looking for any answers so we can get the 64 bit memory advantages. Thank you everyone.

IDE target platform is Windows 64-bit version. We can repeatedly load a large collection as a test, and it always dies on Out of Memory errors like a 32bit version would.

3
  • 3
    Even if you have a lot of RAM on your machine and the app is 64-bit, it may not be possible to allocate a single huge (contiguous) chunk of memory. A very simple test to test the actual bitness of your app: ShowMessage(SizeOf(Pointer).ToString). In a 32-bit app, you get 4. In a 64-bit app, you get 8. Commented Nov 15, 2024 at 16:20
  • Afaik, there are no such "reset to 32" settings. If the build target is set to 64 bit, the result will be in 64 bit, too! Commented Nov 15, 2024 at 21:44
  • 1
    Make sure the large address aware flag is set - it should be by default but it may have gotten changed somehow. However with it unset it should only be getting 2GB not 4GB. Ref: Memory Limits for Windows and Windows Server Releases Commented Nov 15, 2024 at 23:01

2 Answers 2

1

One possibility is the IMAGE_FILE_LARGE_ADDRESS_AWARE flag is cleared.

At: Memory Limits for Windows and Windows Server Releases the cell for 64-bit apps on 64-bit Windows contains: 2 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE cleared.

Table

Sign up to request clarification or add additional context in comments.

Comments

0

Thank you to everyone who offered an idea or explanation. Thanks to all the input, I hunted down a part of code what was trying to set the large address aware option, but i'm guessing the syntax was wrong, yet the compiler did not complain about it. Once i took it out and replaced it with the following syntax

{$LARGEADDRESSAWARE ON}

Then things started working as expected. I thought all of this was supposed to be set to ON by default for a 64 bit build, and have no idea still about where it gets turned off. But nonetheless, mission accomplished.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.