PR# 19147 C compiler runs out of memory when system finalized

Problem Report Summary
Submitter: prestoat2000
Category: C Compilation
Priority: High
Date: 2015/10/22
Class: Support
Severity: Critical
Number: 19147
Release: 15.08.97862
Confidential: No
Status: Closed
Environment: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0
Synopsis: C compiler runs out of memory when system finalized

I added some classes (not that many) to a large system.  Now, when I try to
finalize that system (keeping assertions) on Solaris SPARC 32-bit, the C
compiler runs out of memory when doing code generation (cg process) for
the C1 directory.  This is one of our most important programs.

It appears that there are too many .c files (or too many large .c files)
included in big_file_C1_c.c.

Is there any way to control how many .c files get included in each "big_file"
in finalized (or workbench) mode?  If so, how?  If not, how can I resolve this

I confirmed that if I remove the #include for one of the large .c files from
big_file_C1_c.c, then the compilation works.

To Reproduce

Problem Report Interactions
From:prestoat2000    Date:2016/11/11    Status: Closed    Download   
Since you have provided a solution for this problem (control of number of C files per directory) and since
I also found a workaround, I'm closing this report.

From:prestoat2000    Date:2015/11/02    Download   
I found a workaround.  One class had 6000+ STRING constants, but we really 
only need to reference less than 100 of them.  The class was generated from
data in our database.  Keeping only the constants we currently need allowed
the compilation to finish.

Thanks for implementing the other workaround (workbench and final basket limits)
in case we have problems with another class with many STRING constants.

From:alexk_es    Date:2015/10/30    Download   
A new setting is provided in rev#98053 of EiffelStudio 15.11 intermediate release. ".../studio/eifinit/general.cfg" can be used to specify a maximum limit of C files that can be generated in one directory. The new configuration options are "workbench_c_basket_limit" and "finalized_c_basket_limit" and should be set to a positive integer. The current default values are as before: 33 and 50 respectively.

From:manus_eiffel    Date:2015/10/29    Status: Analyzed    Download   
We are going to implement a compiler option in the general.cfg file to change the default of roughly 100 files per C directory. This is the short term solution. We are going to think a little bit more at the long term solution. 

From:prestoat2000    Date:2015/10/27    Download   
Any word on ideas for a fix or workaround?  This is going to become a big 
issue for us very soon, because for one of our most critical systems, which 
regularly needs modification, the "cg" process of the C compiler almost
runs out of memory.  If I add anything significant, like I will soon need to do,
"cg" will run out of memory and the C compilation will fail.