"[ilink32] Fatal: Out of memory" in C ++ Builder

After upgrading Embarcadero C ++ Builder to the new version, our project will suddenly not be created. This happens with only one of our projects. For most team members, an identical code builds without errors. On my computer, linking does not work every time.

In the Build tab:

[ilink32] Fatal: Out of memory 

On the Output tab:

 Build FAILED. c:\program files (x86)\embarcadero\studio\18.0\Bin\CodeGear.Cpp.Targets(3517,5): error : Fatal: Out of memory 

No more information.

If I enable Link with Dynamic RTL, the project will contact without errors. For example, if our Debug landing page has this setting, the project connects to Debug, but not to Release.

How can I fix this problem? How to increase memory for the linker?

+5
source share
1 answer

Explanation

On your computer, one of the linker chunks is too small for this project. The project associates with the Link with Dynamic RTL option, because in this case the linker needs less memory, and the heap just turns out to be quite large.

You can use the -GH linker option to increase this heap, but first you need to find out which heap is full. To do this, enable the diagnostic output in the linker.

Compilation with diagnostic output

Compilation from the command line:

 call rsvars MSBuild /v:diag YourProject.cbproj 

Compilation from the IDE:

  • Go to Tools> Options> Environment Settings
  • Change Vertex to diagnostics
  • After creating the project, read the output on the Output tab of the Messages window

Heap Sizing

At the end of the output, you should find heap sizes similar to this:

 The "ILINK32" task is using "ilink32" from "c:\program files (x86)\embarcadero\studio\18.0\bin\ilink32.exe". Turbo Incremental Link 6.75 Copyright (c) 1997-2016 Embarcadero Technologies, Inc. Overrun on linker heap: tds Linker Heaps ------------ system 0x030d4000 0x08000000 tds 0x08710000 0x09400000 c:\program files (x86)\embarcadero\studio\18.0\Bin\CodeGear.Cpp.Targets(3517,5): error : Fatal: Out of memory The command exited with code 2. 

In this case, the overflow occurred on the tds heap, so we need to increase its size. The left column indicates the number of bytes used, and the right column indicates the number of bytes allocated. The new size must be greater than the value currently in the right column.

In this case, the tds size was 0x09400000 , so we increase it to 0x0f400000 with the following option: -GHtds=0x0f400000 .

In the IDE, go to Project> Options> C ++ Linker . Add -GHtds=0x0f400000 to Advanced> Advanced Options .

After saving the project settings, compile the project again. If the same heap overflows, you need to increase its size even more. If the other heap is full, you also need to increase its size.

For example, if code a heap overflow now, and you want to increase its size to 0x0a000000 , you should change the Advanced options to -GHtds=0x0f400000 -GHcode=0x0a000000 .

More details

Could not solve this problem?

  • If you are using C ++ Builder 10.0 or 10.1, try fixing your linker as described here: LME288 error in C ++ Builder
  • If you use C ++ Builder 10.2, the linker fix does not work, but you can try other solutions in the same link
+8
source

All Articles