Browse Source

jfinal 3.5

James 7 years ago
parent
commit
6b9ad43ba3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/main/java/com/jfinal/template/io/FastStringWriter.java

+ 2 - 2
src/main/java/com/jfinal/template/io/FastStringWriter.java

@@ -97,7 +97,7 @@ public class FastStringWriter extends Writer {
     	
     	
     }
     }
     
     
-    static int MAX_SIZE = 1024 * 128;
+    static int MAX_SIZE = 1024 * 64;
     
     
     /**
     /**
      * 由 StringWriter.close() 改造而来,原先该方法中无任何代码 ,改造如下:
      * 由 StringWriter.close() 改造而来,原先该方法中无任何代码 ,改造如下:
@@ -107,7 +107,7 @@ public class FastStringWriter extends Writer {
      */
      */
     public void close() {
     public void close() {
     	if (buf.length() > MAX_SIZE) {
     	if (buf.length() > MAX_SIZE) {
-    		buf = new StringBuilder();	// 释放空间占用过大的 buf
+    		buf = new StringBuilder(MAX_SIZE / 2);	// 释放空间占用过大的 buf
 		} else {
 		} else {
 			buf.setLength(0);
 			buf.setLength(0);
 		}
 		}