This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compile unsuccess for Out of memory

My project can't be compiled sucessfully.The error is "out of memory -application aborted".I find when cg6x.exe uses too much memory of computer, the error will occur.

I read some information from a paper that there are too many paths in autoexec.bat(a sysytem file of windows).Is that right?or there is other solutions for "out of memory"?

I am eager for your help!

  • The most likely causes for cg6x.exe running out of memory are that the PC you are using does not have enough memory, or the source code module you are trying to compile is too big.  How many gigabytes of memory (including virtual memory) does your PC have?  Are you running other programs at the same time you are running the compiler?  How many lines of code are there in the source code module you are compiling when the "out of memory" error occurs?

  • Thank you for your help!

    Archaeologist said:
     How many gigabytes of memory (including virtual memory) does your PC have? 

    Memory space in my PC is 8775MB.

    Archaeologist said:
       Are you running other programs at the same time you are running the compiler?

    NO.I am not.I compile the only one programm.and I didn't do anything else operation on my PC.

    Archaeologist said:
      How many lines of code are there in the source code module you are compiling when the "out of memory" error occurs?

    The source code is large. Its size is more than 3MB.I think the reason of thisproblem  is that my  model is too big ,But I may be need a larger model.So I must solve the "out of memory".

    could you give me some suggestion ?

    I am eager for your help!

  • yan jie said:

    The source code is large. Its size is more than 3MB.

    Is that just one source file that is 3MB?  That's pretty large for one file.  How many functions are in that file?

    Try to break the source file up into smaller chunks, and large functions into smaller functions.

    What version of the compiler are you using?  (I'm going to presume 6.0.27, as you've stated in a different thread).

    There have been improvements to the compiler's memory usage profile since the 6.0.x branch; can you try using a 7.x version to see if the situation has improved?

     

  • Archaeologist said:
    Is that just one source file that is 3MB? 

    No, the whole project is 3MB,but the lagest one file is about 1.3MB.

    Archaeologist said:
      What version of the compiler are you using? 

    The version of CCS is v3.3.81.6 , version of code generation tools is v6.0.27,DSP/BIOS is v5.31.08.

    Archaeologist said:
      can you try using a 7.x version ...? 

    I have tried the code generation tools v7.0.2,but when I run compile, the opt6x.exe was run for 4 hours. And some project compiling failed,which can be compiled successfully  with version 6.0.27.

    What should I do ?

  • Are you able to break your functions into smaller functions?  How big is your longest function?

  • Archaeologist said:
    Are you able to break your functions into smaller functions?  How big is your longest function?

    The largest source file is the data-array and structures which are initialized.some of those data-array maybe too large,but  I cann't break it into smaller.

    1) I have read "TMS320C6x C Source Debugger User’s Guide(Literature Number: SPRU188D January 1998)",there is a tips for "Cannot allocate host memory",it says to invoke the debugger with the –v option.Maybe the article is a little  out of date.Is there a new version?

    2)I have read "C6000 C/C++ CODE GENERATION TOOLS 7.0.2 April 2010 Defect History",as following:

    FIXED  SDSCM00035558

    Summary            : Fix shell memory allocation errors in the compiler shell

    Fixed in           : 7.0.2

    Severity           : S2 - Major

    Affected Component : Shell

    Description:

    The shell could crash if the host OS were to run out of available heap memory.The shell would not report any "out of memory" error.

    SO I think If I use CGT7.0.2,then the problem will be solved! But Why I cann't use CGT7.0.2 successfully?Must I uninstall CGT6.0.27?

    I am eager for your help.

  • yan jie said:
    The largest source file is the data-array and structures which are initialized.some of those data-array maybe too large,but  I cann't break it into smaller.

    It is unlikely a large array is the cause of your problem.  Focus on the size of the functions.  Really big functions can cause problems.

    yan jie said:
    1) I have read "TMS320C6x C Source Debugger User’s Guide(Literature Number: SPRU188D January 1998)",there is a tips for "Cannot allocate host memory",it says to invoke the debugger with the –v option.Maybe the article is a little  out of date.Is there a new version?

     

    This has nothing to do with your problem.  That book is older than Code Composer Studio.  Did you find that on the TI web site?  If so, it really shouldn't be there.

    yan jie said:

    2)I have read "C6000 C/C++ CODE GENERATION TOOLS 7.0.2 April 2010 Defect History",as following:

    FIXED  SDSCM00035558

    Installing the v7.0.2 compiler might help.  This is a fix to the compiler shell cl6x.  Your original complaint is about the code generation pass cg6x.  So I wouldn't count on this being the solution.  You can get v7.0.2, and other compiler releases, from here.

    Thanks and regards,

    -George

     

  • Georgem said:
    Focus on the size of the functions.  Really big functions can cause problems.

    I looked through my project again.I think you are right.I will try to break the big function into smaller ones.

  • Georgem said:
    Focus on the size of the functions.  Really big functions can cause problems.

    I looked through my project again.I think you are right.I will try to break the big function into smaller ones.

  • Thank   Georgem very much!!!

    The problem has been solved.It is the big function.After I break the big function into some smaller files,then the compilation succeed!!

    Wish you happy everyday!!

  • By the way,How much the maxsize of a function or a file is?

  • There is not a single fixed maximum size for file or function.  As a function becomes larger, compiling it becomes more complex, and some of that complexity increases faster than the size of the function does.  The data structures used during compilation also may grow faster than the function, in a way that depends strongly on exactly what the function looks like.

    There is usually little benefit in having a large function.  It is usually better to write smaller functions, which are easier to understand and debug, and use the compiler's controls for inlining to reduce function-call overhead where necessary.

  • I understand.Thank you very much.