Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

RAM error?

Hello champs,

I am running two applications. And each one of them calls the other. It all seems fine until on the 13th loop or so it does this. I'm sorry if the code post is too long, but I guess its better if I show the complete output. If anyone has an idea of what this may be and how to solve it, it will be highly appreciated! ho ho

Code:

empieza rutina_buffer1

termina rutina_buffer2

[114]

empieza rutina_buffer2

termina rutina_buffer1

[118]

empieza rutina_buffer1

termina rutina_buffer2

[122]

empieza rutina_buffer2

termina rutina_buffer1 <---- This is all part of the normal function and then BOOM!! something about memory

[126]

empieza rutina_buffer1

touch: page allocation failure. order:7, mode:0xd0

Stack from 00f39da0:<0>

****** <0> 00000007<0> 0084b4e0<0> 00000001<0> 00000048<0> 00000000<0> 00000000<0> 00000001<0> 00000000<0>

****** <0> 000200d0<0> 00a3e838<0> 00000002<0> 0004e000<0> 00000001<0> 00b604ac<0> 00b617ac<0> 00000000<0>

****** <0> 00000007<0> 00a28b38<0> 00000000<0> 00857af8<0> 00a43060<0> 00000004<0> 00000000<0> 00005900<0>

****** <0> 0004e000<0> 00000007<0> 00000005<0> 00003ef5<0> 00007b50<0> 0003de80<0> 00000005<0> 00000004<0>

****** <0> 00005900<0> ffffe000<0> 00a42e00<0> 0089f624<0> 00000002<0> 00000000<0> ffffffff<0> 0084b1a4<0>

****** <0> 00000010<0> 00000000<0> 00000000<0> 00000000<0> 00000000<0> 00000000<0> 00000000<0> 00000000<0>

Call Trace:<0>

****** <0> [<0084b1a4>]<0> [<0089ef3c>]<0> [<00865d30>]<0> [<008662dc>]<0>

****** <0> [<00801e70>]<0> [<00800c80>]<0> [<008006c0>]<0>

Mem-Info:

DMA per-cpu:

CPU****0: hi:****0, btch:** 1 usd:** 0

Active_anon:0 active_file:0 inactive_anon:0

inactive_file:9 unevictable:393 dirty:0 writeback:0 unstable:0

free:612 slab:181 mapped:0 pagetables:0 bounce:0

DMA free:2448kB min:360kB low:448kB high:540kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:36kB unevictable:1572kB present:8128kB pages_scanned:0 all_unreclaimable? no

lowmem_reserve[]: 0 0 0

DMA: 12*4kB 12*8kB 16*16kB 18*32kB 13*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 2448kB

402 total pagecache pages

0 pages RAM

0 pages reserved

0 pages shared

0 pages non-shared

Allocation of length 319488 from process 128 (touch) failed

DMA per-cpu:

CPU****0: hi:****0, btch:** 1 usd:** 0

Active_anon:0 active_file:0 inactive_anon:0

inactive_file:9 unevictable:393 dirty:0 writeback:0 unstable:0

free:612 slab:181 mapped:0 pagetables:0 bounce:0

DMA free:2448kB min:360kB low:448kB high:540kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:36kB unevictable:1572kB present:8128kB pages_scanned:0 all_unreclaimable? no

lowmem_reserve[]: 0 0 0

DMA: 12*4kB 12*8kB 16*16kB 18*32kB 13*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 2448kB

402 total pagecache pages

Unable to allocate RAM for process text/data, errno 12

Shell invoked to run file: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������-c: No such file or directory

termina rutina_buffer2

Thanks in advance,

Regards,

Francisco

7 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello again,

    I have news, I think the problem is in the speed in which the serial port is being read, this makes the buffer full and leaves no RAM space for the other processes? I don&#39;t know , it is a hunch :P I did notice that input data is faster than the speed in which it is being stored. So I guess it could be a problem, but don&#39;t know if the error is causing the upper output.

    Still haven&#39;t found a solution to the problem.

    Regards,

    Francisco
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I suppose you need to rethink the general structure of the project and use either a single (i.e. threaded) program or use two programs that keep running (daemons) and communicate by stuff like pipes or shared memory.

    Starting programs in the current (nommu) toolchain costs a lot of CPU time and memory. The upcoming MMU-enabled ggc4 toolchain might support XIP and allow for fast program start and much less memory overhead. But even then, I feel that starting programs in a very fast cycle is not a good idea.

    -Michael
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello Michael,

    so whenever the appplications are started is when they consume the most? You are talking about overhead. Hmm that gives me a good idea. However, ftpput has still to be called. Or is it about ftpput that you refer to a daemon? I was also thiking about SSH, there was a thread about that here on the forum but I guess it was lost. Could you please be a little more specific?

    Thank you very much

    Francisco
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE (franciscoheredia @ Jun 30 2009, 01:17 PM) <{post_snapback}> (index.php?act=findpost&pid=22959)</div>

    --- Quote Start ---

    . However, ftpput has still to be called. Or is it about ftpput that you refer to a daemon?[/b]

    --- Quote End ---

    You can create an "ftpput-deamon" or integrate ftpput in your program. FTP is not a complicated protocol and moreover you can take a look at the ftpput sourcecode, I suppose there are libraries you can use.

    <div class='quotetop'>QUOTE (franciscoheredia @ Jun 30 2009, 01:17 PM) <{post_snapback}> (index.php?act=findpost&pid=22959)</div>

    --- Quote Start ---

    . I was also thiking about SSH, there was a thread about that here on the forum but I guess it was lost.[/b]

    --- Quote End ---

    Of course the ssh-basted "scp" is the modern, more secure and more versatile version of ftp. I would use same for a new project, but I did not yet use it.

    <div class='quotetop'>QUOTE (franciscoheredia @ Jun 30 2009, 01:17 PM) <{post_snapback}> (index.php?act=findpost&pid=22959)</div>

    --- Quote Start ---

    .Could you please be a little more specific?[/b]

    --- Quote End ---

    With what issue.

    -Michael
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    I suppose you need to rethink the general structure of the project and use either a single (i.e. threaded) program or use two programs that keep running (daemons) and communicate by stuff like pipes or shared memory.[/b]

    --- Quote End ---

    Ok, A single threaded program would then be one routine that fills one buffer at the same time, but WITHIN the same program, instead of using two programs. This would only assign and call one program instead of repeatedly closing and opening them. This would eliminate a big part of overhead at starting processes ?

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    You can create an "ftpput-deamon" or integrate ftpput in your program. FTP is not a complicated protocol and moreover you can take a look at the ftpput sourcecode, I suppose there are libraries you can use.[/b]

    --- Quote End ---

    I&#39;ve found the source file por perl. I am trying to test and translate whichever needs to be changed to be compatible with the shell. I am still new to this but making a big effort to get it done. I suppose the souorce file is then compiled as a regular program with the nio2-linux-uclibc-gcc command?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    re 1) I did not suggest to call any executable, but either run two executable in parallel (started when booting and never stopping), or do a single executable with two threads (via the pthread library), one for data acquisition and one doing ftp (but not calling an external program).

    I have no experience with perl, but as it&#39;s an interpreted language it will add some overhead. I also don&#39;t know if there is a working perl interpreter for NIOS-nommu.

    -Michael
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello Michael,

    Thanks for your answer. I will look into your suggestions and let you know about the results. :)

    Regards,

    Francisco