Welcome to the Linux Foundation Forum!

Changing limits with ulimit (Lab 3.1)


Hi everyone,

I am a bit unclear as to why exercise #4 in lab 3.1 results in an operation not permitted error. The solution states, "Note that if we had chosen a different limit, such as stack size (-s) we could raise back up again as the hard limit is unlimited.". What exactly does stack size refer to and how does it make a difference?

Thanks in advance.


  • luisviveropena
    luisviveropena Posts: 1,179
    edited July 2018


    From the documentation:

     ulimit [-HSTabcdefilmnpqrstuvx [limit]]

                  Provides control over the resources  available  to  the  shell  and  to  processes

                  started  by it, on systems that allow such control.  The -H and -S options specify

                  that the hard or soft limit is set for the given resource.  A hard limit cannot be

                  increased  by  a non-root user once it is set; a soft limit may be increased up to

                  the value of the hard limit.

    ==> a soft limit may be increased up to the value of the hard limit.

    If you want to take a look, check the man or info page for ulimit.



  • gacanepa
    gacanepa Posts: 8
    edited July 2018


    Please note that my question refers to the meaning of the words stack size, and how that would have made a difference in the proposed lab exercise.

    PS: Since ulimit is a shell builtin, it does not have a standalone man page. And as far as I can see, neither the shell builtins' man page nor the info page on ulimit explain the concept of stack size.

  • coop
    coop Posts: 915
    edited July 2018

    you can get info on "ulimit" by typing "help ulimit" as it is a built in bash command.  You can't expect that to exlain what all the possibility parameters do.


    Stack is the amount of memory avaialble to a process for static variables, such as arrays and other storage.  Every process created is allotted such memory when it starts; by default on Linux 8MB is granted usually -- that is not so much unless you start creating thousands of processes, such as a server might, in which case you might want to limit it.  

    The stack is an important *programming* concept in any computing language, but a normal user would not be terribly aware of it.  I'm sure a little bit of googing or look at the wikipedia would give you a deeper undrerstanding of its role in any operating system, nut just Linux.


Upcoming Training