From 4ebfdd3679ae46341b25f1aa3ba95480d6c514d1 Mon Sep 17 00:00:00 2001
From: ph10
If the find_limits modifier is present on a subject line, pcre2test
calls the relevant matching function several times, setting different values in
-the match context via pcre2_set_heap_limit(), \fBpcre2_set_match_limit(),
-or pcre2_set_depth_limit() until it finds the minimum values for each
-parameter that allows the match to complete without error.
+the match context via pcre2_set_heap_limit(),
+pcre2_set_match_limit(), or pcre2_set_depth_limit() until it finds
+the minimum values for each parameter that allows the match to complete without
+error. If JIT is being used, only the match limit is relevant.
-If JIT is being used, only the match limit is relevant. If DFA matching is
-being used, only the depth limit is relevant.
-
-The match_limit number is a measure of the amount of backtracking
-that takes place, and learning the minimum value can be instructive. For most
-simple matches, the number is quite small, but for patterns with very large
-numbers of matching possibilities, it can become large very quickly with
-increasing length of subject string.
+When using this modifier, the pattern should not contain any limit settings
+such as (*LIMIT_MATCH=...) within it. If such a setting is present and is
+lower than the minimum matching value, the minimum value cannot be found
+because pcre2_set_match_limit() etc. are only able to reduce the value of
+an in-pattern limit; they cannot increase it.
For non-DFA matching, the minimum depth_limit number is a measure of how
@@ -1460,6 +1457,22 @@ searched). In the case of DFA matching, depth_limit controls the depth of
recursive calls of the internal function that is used for handling pattern
recursion, lookaround assertions, and atomic groups.
+For non-DFA matching, the match_limit number is a measure of the amount
+of backtracking that takes place, and learning the minimum value can be
+instructive. For most simple matches, the number is quite small, but for
+patterns with very large numbers of matching possibilities, it can become large
+very quickly with increasing length of subject string. In the case of DFA
+matching, match_limit controls the total number of calls, both recursive
+and non-recursive, to the internal matching function, thus controlling the
+overall amount of computing resource that is used.
+
+For both kinds of matching, the heap_limit number (which is in kilobytes)
+limits the amount of heap memory used for matching. A value of zero disables
+the use of any heap memory; many simple pattern matches can be done without
+using the heap, so this is not an unreasonable setting.
+
The memory modifier causes pcre2test to log the sizes of all heap
memory allocation and freeing calls that occur during a call to
-pcre2_match(). These occur only when a match requires a bigger vector
-than the default for remembering backtracking points. In many cases there will
-be no heap memory used and therefore no additional output. No heap memory is
-allocated during matching with pcre2_dfa_match or with JIT, so in those
-cases the memory modifier never has any effect. For this modifier to
-work, the null_context modifier must not be set on both the pattern and
-the subject, though it can be set on one or the other.
+pcre2_match() or pcre2_dfa_match(). These occur only when a match
+requires a bigger vector than the default for remembering backtracking points
+(pcre2_match()) or for internal workspace (pcre2_dfa_match()). In
+many cases there will be no heap memory used and therefore no additional
+output. No heap memory is allocated during matching with JIT, so in that case
+the memory modifier never has any effect. For this modifier to work, the
+null_context modifier must not be set on both the pattern and the
+subject, though it can be set on one or the other.
Showing MARK names
@@ -1476,13 +1489,14 @@ Showing memory usage
Setting a starting offset
@@ -1982,9 +1996,9 @@ Cambridge, England.
-Last updated: 21 December 2017
+Last updated: 25 April 2018
-Copyright © 1997-2017 University of Cambridge.
+Copyright © 1997-2018 University of Cambridge.
Return to the PCRE2 index page. -- cgit v1.2.1