1

I'm transfering project for C++ Builder 6 on Embarcadero RAD Studio 10.4 and change platform with x86 on x64. My project include five *.dll and two *.exe files. I success transfer four *.dll on x64 platform, but fifth *.dll report about error. When *.dll - file make, I get message about error: "Out of memory". I visited url:

http://docwiki.embarcadero.com/RADStudio/Sydney/en/Handling_Out_of_Memory_Errors

and found out, that in my happening overflow three heap:

  • Code Heap Size
  • Dwarf str Heap Size
  • Info Heap Size

Little by little I enlarged size all heaps. But, soon I reached limitation: "[ilink64 Error] Fatal: Malloc of 65536 bytes failed in ........\bins\Win64\Debug\my_dll.ildw_str, line 6" About this signaling Dwarf str Heap Size. I visited url:

https://stackoverflow.com/a/37537734/9494441

and maked all tips.

I tryed:

  • Setted Large Address Aware flag with the lamarker tool
  • Replace ilink32.exe and ilink64.exe program RAD Studio with version 10.4 on version 10.2.3
  • Incremental linker disabled/enabled
  • Manually removing all files in /debug
  • all rebuild
  • add files to the antivirus exclusions ilink32.exe and ilink64.exe

Me didn't help nothing. How fix this problem? Thanks!

Range
  • 416
  • 7
  • 20

1 Answers1

1

This is happening only in debug, right?

4 options you have:

  1. Reduce the memory of the sections you are allocating more than you project needs. Not to allocate more memory than neede in the other sections.
  2. Reduce all the symbols your modules are expose to. I've been told that the linker does not detect duplicates and same symbols get included again and again making the things worse. If the project is old and have a poor include policy you might have something to work on there
  3. Compile all in release and enable debug info only on the modules you are going to debug.
  4. Try to use 10.3.1 where C++ win64 was not yet C++17. In 10.3.2 Win64 was upgraded to C++17 making the linker problem more likely to happen.
webadm
  • 51
  • 5
  • Paragraph 3) -> You saying about enable debugging symbols for separate cpp-modules or dll-files? – Range Sep 29 '20 at 13:13
  • You can do both...it depends on how close you are to the linker limits. I never followed that path, but it was recomended to me. – webadm Oct 19 '20 at 03:41
  • I tryed all, but nothing no working...ThereforeI disabled debug info (temped). – Range Oct 19 '20 at 12:32
  • Does all compile in release mode? – webadm Oct 19 '20 at 17:37
  • yes, but me need debug mode :c app contains different errors, that i want debugging us – Range Oct 22 '20 at 18:43
  • compilation selected parts app(cpp files) in release mode not to gived thier debugging, becouse debugger embarcadero hangs – Range Oct 22 '20 at 18:49
  • 1
    If you have an active subscription and you are eligible for 3 support request. Contact your sales representative to get information on how to file for a support ticket. – webadm Oct 22 '20 at 22:24
  • What I had to end up doing is to develop in Win32 clang. Mostly of the times is enough. – webadm Oct 23 '20 at 21:09
  • Thanks per idea:) i debugged app with help my library (output stack trace and debug output to console. old school ahah). Unfortunate my app must be support win64, becouse app using more 4gb memory. – Range Oct 23 '20 at 22:36
  • how you get the stack trace in c++ builder if I may ask? I also use console debugging too and when I can't udp debugging...but not ideal. – webadm Oct 24 '20 at 02:03
  • I writed library, using this tutorial: (he is writed russian language, sorry) https://habr.com/ru/post/148781/ ; and I added changes, that make this more comfort – Range Oct 24 '20 at 16:54