Not sure about this case, but for me "Out of memory" is very common error for big modules in Delphi. In most cases it's caused by debug information for generics. Generics have long names. Especially when they're nested. I.e. something like "TGeneric1<TSomeType, TGeneric2<TSomeOtherType>>". This is one of the reasons, why I want to migrate to FPC.
UPD May be I have old sources. It's 3.0.0 sources. Don't have time to download new ones. And according to this sources, this internal error can happen in one of two places:
1) When reading long PE section name (that is longer, than 8 symbols). Dunno, if FPC uses long section names. I guess, it shouldn't.
2) When reading symbol table, mostly used as debug info.
This error happens, if:
1) Pointer to symbol table is nil.
2) Position to read exceeds size of symbol table.
3) #0 is found at that position, i.e. zero length string.
So, I guess, it's broken symbol table.