c++out-of-memoryfatal-errorc++builder-10.1-berlin

How may I resolve a file containing 65k lines of code causing a [bcc32 Fatal Error] F1008 Out of memory error?


I'm using Embarcadero C++ Builder 10.1 Berlin Update 2.

I added one file to a project. I tried to build said project and the build failed and reported the following error: [bcc32 Fatal Error] FileName.cpp(44329): F1008 Out of memory

I have been reading up on errors that can be found via Google and am only finding linker errors. My understanding is that this isn't a linker error as I'm not seeing [ilink32]. I haven't come across any examples of this error.

The file I added has 25 lines in the h file and 64865 lines in the cpp file. The following method takes up 64755 lines of the cpp file.

void __fastcall TFileName::PopulateKeyValueList()
{
    SOKeyValueList->Clear();
    SOKeyValueList->AddPair("AKey","AValue");
    ... roughly 64750 more lines like the one above adding pairs to the list
}

This wasn't an issue before I added the file containing 65k lines of code to the project so I believe the appropriate question is, how may I resolve a file containing 65k lines of code causing a [bss32 Fatal Error] F1008 Out of memory error?


Solution

  • It’s generally not a good idea to hard code data (especially so much data in your case) into a source file. You should put key-value pair info in a file and read them out to build the key-value list.

    For the error, I guess the compiler you used is just not good enough to handle large source files.