Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12745 Discussions

Out of memory error while compiling the altia generated files using nios gcc compiler

Altera_Forum
Honored Contributor II
2,170 Views

nios2-elf-gcc.exe is used for compiling the altia generated images and font files. File size is 64MB. An error is thrown while compiling as out of memory. 

Is there is any limitaion of file size or size of arrays inside the file in gcc compiler. If there is any how to update them to have for bigger size. 

 

Thanks in advance. 

0 Kudos
11 Replies
Altera_Forum
Honored Contributor II
1,106 Views

I don't believe gcc has any internal limits - other than available system memory. 

If you are compiling a 64MB C source file you probably need a lot of memory/swap. 

I'm not sure if windows has per process memory limits (cf ulimit), but it might be that the windows swap/page file isn't big enough.
0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

How we can identify if it is windows issue.

0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

Watch the task manager ... 

Does anything small compile? 

Some Cygwin issues might be reported as 'out of memory' when that isn't the real issue.
0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

We are able to compile the file of 41MB size. Now when we added some more fonts size increased to 64MB. This i am not able to compile.

0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

I would compile each font in a separate file. 

But look at the windows page file use in the task manager
0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

I have been compiling memory error but compile in another pc and it works.

0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

I would compare the windows memory settings of both PCs. 

then also the parameter that are used to start the NIOS IDE.
0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

I verified the PF usage in windows. while compiling the font file it reaches 2.5GB and then it gone down to 640mb and the copmilation stopped with  

out of memory error. The PF limit is around 5GB(5297172).
0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

That looks like the gcc program image is exceeding the available user address space - 2GB on 32bit windows. 

 

Depending of the exact contents of the font files, changing the compiler options (maybe turn off the optimiser if they are only data) might help. 

But you'll only hit the limit again later. 

I think you need to work out how to compile the fonts in small groups.
0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

Thank you dsl for the response. We tried splitting the font files generated from Altia.Now the compilation is successful. But we increased the font characters and the files splitted are coming to 20 files. When we tried to compile them i am getting another error. 

 

nios2-elf-insert nios2/rel/product.d09 --cpu_name NIOSII_processor --id 1995561430 --sidp 0x4005000 --stderr_dev jtag_uart --stdin_dev jtag_uart --stdout_dev jtag_uart 

OutOfMemoryError: Java heap space 

 

Any thoughts on this error. 

0 Kudos
Altera_Forum
Honored Contributor II
1,106 Views

At a guess nios2-elf-insert is java (or runs some java) that is trying to load the entire elf image into memory - and is failing because it is too big! 

I don't know what nios2-elf-insert does - I don't use the Altera build scripts at all. 

You might need to look at the the output of 'objdump -h' (and maybe 'objdump -p') to see which sections have gopt quite so big. 

If they are loadable sections you're going to have trouble finding enough memory on the fpga board to hold all the data!
0 Kudos
Reply