jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1451929 - in /jmeter/trunk/src: components/org/apache/jmeter/extractor/RegexExtractor.java core/org/apache/jmeter/util/JMeterUtils.java
Date Sat, 02 Mar 2013 19:48:59 GMT
Author: pmouawad
Date: Sat Mar  2 19:48:59 2013
New Revision: 1451929

URL: http://svn.apache.org/r1451929
Log:
Bug 54268 - Improve CPU and memory usage
Factor out code
Bugzilla Id: 54268

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java?rev=1451929&r1=1451928&r2=1451929&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/RegexExtractor.java Sat Mar  2
19:48:59 2013
@@ -164,23 +164,7 @@ public class RegexExtractor extends Abst
         } catch (MalformedCachePatternException e) {
             log.error("Error in pattern: " + regex);
         } finally {
-            clearMatcherMemory(matcher, pattern);
-        }
-    }
-
-    /**
-     * Hack to make matcher clean the two internal buffers it keeps in memory which size
is equivalent to 
-     * the unzipped page size
-     * @param matcher {@link Perl5Matcher}
-     * @param pattern Pattern
-     */
-    private final void clearMatcherMemory(Perl5Matcher matcher, Pattern pattern) {
-        try {
-            if(pattern != null) {
-                matcher.matches("", pattern); // $NON-NLS-1$
-            }
-        } catch (Exception e) {
-            // NOOP
+            JMeterUtils.clearMatcherMemory(matcher, pattern);
         }
     }
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java?rev=1451929&r1=1451928&r2=1451929&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java Sat Mar  2 19:48:59 2013
@@ -1309,4 +1309,20 @@ public class JMeterUtils implements Unit
         System.gc();
         System.runFinalization();
     }
+    
+    /**
+     * Hack to make matcher clean the two internal buffers it keeps in memory which size
is equivalent to 
+     * the unzipped page size
+     * @param matcher {@link Perl5Matcher}
+     * @param pattern Pattern
+     */
+    public static final void clearMatcherMemory(Perl5Matcher matcher, Pattern pattern) {
+        try {
+            if(pattern != null) {
+                matcher.matches("", pattern); // $NON-NLS-1$
+            }
+        } catch (Exception e) {
+            // NOOP
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message