F2046

Delphi Programming Language

Severity: Moderate

What it means

The message: F2046 Out of memory.
Embarcadero: RAD Studio's built-in compiler ran out of memory.
It's rare, and can happen when you build an extremely large project group of applications and libraries.

Affected Models

  • RAD Studio's built-in Delphi compiler

How to Fix It

  1. Check the swap file is large enough, and the disk still has free space.

    In Windows: System > Advanced system settings > Performance Settings > Advanced > Virtual memory.

  2. Build outside the IDE. In Project > Options > Delphi Compiler, tick Use MSBuild externally to compile.

    To debug an app built this way, also turn on Include remote debug symbols, under Project > Options > Delphi Compiler > Linking.

  3. Or build the project group on the command line.

  4. For the longer run, Embarcadero suggests making the applications and libraries rely more on Delphi packages. Packages don't make the IDE run out of memory.

Frequently Asked Questions

Is F2046 the same as EOutOfMemory?

No. F2046 comes from the compiler, while you build.
EOutOfMemory is an exception your own program raises when it runs out of memory.