diff --git a/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java b/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java index 6c2abeb90..2aceeba6b 100644 --- a/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java +++ b/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java @@ -83,7 +83,7 @@ import javax.servlet.http.Part; @MultipartConfig( maxFileSize = 1L << 26, // ~64MB maxRequestSize = 1L << 26, // ~64MB - fileSizeThreshold = 1 << 20, // ~1MB + fileSizeThreshold = 1 << 23, // ~8MB location = "/tmp") @WebServlet(value = "/w/decode", loadOnStartup = 1) public final class DecodeServlet extends HttpServlet { diff --git a/zxingorg/src/main/java/com/google/zxing/web/DoSFilter.java b/zxingorg/src/main/java/com/google/zxing/web/DoSFilter.java index 4d2c97914..e532d3905 100644 --- a/zxingorg/src/main/java/com/google/zxing/web/DoSFilter.java +++ b/zxingorg/src/main/java/com/google/zxing/web/DoSFilter.java @@ -82,6 +82,13 @@ public final class DoSFilter implements Filter { bannedIPAddresses.clear(); } }, 0L, TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES)); + timer.scheduleAtFixedRate( + new TimerTask() { + @Override + public void run() { + System.gc(); + } + }, 0L, TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES)); } @Override