title: How big is the stack memory for a certain program, and are there any compiler flags that can set it?
body: <p>As the title states: Is there any general "rule of thumb" about the size of the stack. I'm guessing the size will vary depending on the OS, the architecture, the size of the cache(s), how much RAM is available etc. </p>
  
  <p>However can anything be said in general, or is there any way to find out, how much of the stack, <em>this</em> program is allowed to use?. As a bonus question is there any way (with compiler flags etc. (thinking mostly C/C++ here, but also more general)) that the size of the stack can be set to a fixed size by the user?</p>
  
  <p>Btw, I'm asking strictly out of curiosity, I'm not having a stack overflow. :)</p>