• Not Answered

Where to check or change the stack size/heap size ?

In Linux SDK, where can I check or change the stack size and heap size of the ARM program and DSP program ?

3 Replies

  • For the stack size of a DSP program, perhaps look a the linker command file for the DSP program.
    On the arm to get the current Stack size, 
    root@am180x-evm:~# ulimit -a
    time(seconds)        unlimited
    file(blocks)         unlimited
    data(kb)             unlimited
    stack(kb)            8192
    coredump(blocks)     0
    memory(kb)           unlimited
    locked memory(kb)    64
    process              989
    nofiles              1024
    vmemory(kb)          unlimited
    locks                unlimited
     
    << setting the stack size on the ARM to 32K >>
    root@am180x-evm:~# ulimit -s 32768
    root@am180x-evm:~# ulimit -a
    time(seconds)        unlimited
    file(blocks)         unlimited
    data(kb)             unlimited
    stack(kb)            32768
    coredump(blocks)     0
    memory(kb)           unlimited
    locked memory(kb)    64
    process              989
    nofiles              1024
    vmemory(kb)          unlimited
    locks                unlimited
     
  • In reply to Schuyler Patton:

    Hi Schuyler,

     

    Your method is not a permanent change because I need to change it every time when I run the program.

    How can I change stack size permanently so that when I compile and run the ARM program, the change is permanent ?

    Similarly, how to permanently change the heap size size of the ARM program ?

     

    Thanks,

    Mr Tan

     

  • In reply to std:

    There are no limits stored in the program file.

    Heap and stack sizes are user resource limits, which can be set for all programs run from a shell with the ulimit command, or from the program itself with the setrlimit system call (if the user has sufficient privileges; see the man page).