/[pcre]/code/trunk/doc/html/pcrestack.html
ViewVC logotype

Diff of /code/trunk/doc/html/pcrestack.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 902 by ph10, Sat Jan 14 11:16:23 2012 UTC revision 903 by ph10, Sat Jan 21 16:37:17 2012 UTC
# Line 130  documentation. Line 130  documentation.
130  </P>  </P>
131  <P>  <P>
132  As a very rough rule of thumb, you should reckon on about 500 bytes per  As a very rough rule of thumb, you should reckon on about 500 bytes per
133  recursion. Thus, if you want to limit your stack usage to 8Mb, you  recursion. Thus, if you want to limit your stack usage to 8Mb, you should set
134  should set the limit at 16000 recursions. A 64Mb stack, on the other hand, can  the limit at 16000 recursions. A 64Mb stack, on the other hand, can support
135  support around 128000 recursions.  around 128000 recursions.
136  </P>  </P>
137  <P>  <P>
138  In Unix-like environments, the <b>pcretest</b> test program has a command line  In Unix-like environments, the <b>pcretest</b> test program has a command line
# Line 143  string. This is done by calling <b>pcre[ Line 143  string. This is done by calling <b>pcre[
143  limits.  limits.
144  </P>  </P>
145  <br><b>  <br><b>
146    Obtaining an estimate of stack usage
147    </b><br>
148    <P>
149    The actual amount of stack used per recursion can vary quite a lot, depending
150    on the compiler that was used to build PCRE and the optimization or debugging
151    options that were set for it. The rule of thumb value of 500 bytes mentioned
152    above may be larger or smaller than what is actually needed. A better
153    approximation can be obtained by running this command:
154    <pre>
155      pcretest -m -C
156    </pre>
157    The <b>-C</b> option causes <b>pcretest</b> to output information about the
158    options with which PCRE was compiled. When <b>-m</b> is also given (before
159    <b>-C</b>), information about stack use is given in a line like this:
160    <pre>
161      Match recursion uses stack: approximate frame size = 640 bytes
162    </pre>
163    The value is approximate because some recursions need a bit more (up to perhaps
164    16 more bytes).
165    </P>
166    <P>
167    If the above command is given when PCRE is compiled to use the heap instead of
168    the stack for recursion, the value that is output is the size of each block
169    that is obtained from the heap.
170    </P>
171    <br><b>
172  Changing stack size in Unix-like systems  Changing stack size in Unix-like systems
173  </b><br>  </b><br>
174  <P>  <P>
# Line 190  Cambridge CB2 3QH, England. Line 216  Cambridge CB2 3QH, England.
216  REVISION  REVISION
217  </b><br>  </b><br>
218  <P>  <P>
219  Last updated: 10 January 2012  Last updated: 21 January 2012
220  <br>  <br>
221  Copyright &copy; 1997-2012 University of Cambridge.  Copyright &copy; 1997-2012 University of Cambridge.
222  <br>  <br>

Legend:
Removed from v.902  
changed lines
  Added in v.903

  ViewVC Help
Powered by ViewVC 1.1.5