[lkml]   [2004]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRE: Problem with mlockall() and Threads: memory usage

    > Thanks for that.
    > I have done some more investigating, and on my system (Standard RedHat 9)
    > the stack ulimit is set to 8192 KBytes. So it appears that the thread
    > library/kernel threads pre-allocates, and writes to, 8129 KBytes
    > of stack per
    > thread and so then mlockall() locks all of this in memory.
    > Should'nt the Thread library grow the stack rather than
    > preallocate it all even
    > with mlockall() like malloc ?

    I thought you wanted improved latency. Surely having to find a page for you
    when your stack grows will add unpredictable latency. So, no, the thread
    library should reserve the stack when 'mlockall(MCL_FUTURE)' is specified.

    I do agree that having an 'initial stack size' in additional to a 'maximum
    stack size' would be a good idea. The former good for application that are
    concerned about physical memory usage and the latter for applications
    concerned about virtual memory usage.


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:03    [W:0.021 / U:0.884 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site