mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Run full GC periodically to try to fight memory issue with ImageIO objects with large offheap allocations (?)
This commit is contained in:
parent
7a5038a070
commit
0000a10272
|
@ -83,7 +83,7 @@ import javax.servlet.http.Part;
|
||||||
@MultipartConfig(
|
@MultipartConfig(
|
||||||
maxFileSize = 1L << 26, // ~64MB
|
maxFileSize = 1L << 26, // ~64MB
|
||||||
maxRequestSize = 1L << 26, // ~64MB
|
maxRequestSize = 1L << 26, // ~64MB
|
||||||
fileSizeThreshold = 1 << 20, // ~1MB
|
fileSizeThreshold = 1 << 23, // ~8MB
|
||||||
location = "/tmp")
|
location = "/tmp")
|
||||||
@WebServlet(value = "/w/decode", loadOnStartup = 1)
|
@WebServlet(value = "/w/decode", loadOnStartup = 1)
|
||||||
public final class DecodeServlet extends HttpServlet {
|
public final class DecodeServlet extends HttpServlet {
|
||||||
|
|
|
@ -82,6 +82,13 @@ public final class DoSFilter implements Filter {
|
||||||
bannedIPAddresses.clear();
|
bannedIPAddresses.clear();
|
||||||
}
|
}
|
||||||
}, 0L, TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES));
|
}, 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
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue