Package org.wicketstuff.nashorn.resource
Class NashornMemoryWatcher
java.lang.Object
org.wicketstuff.nashorn.resource.NashornMemoryWatcher
- All Implemented Interfaces:
Runnable
The memory watcher is used to detect memory leaks. If the check interval is to low a high cpu
impact is the consequence. if it is to high a program might swallow to much memory and a oom
exception occurs.
- Author:
- Tobias Soloschenko
-
Constructor Summary
ConstructorDescriptionNashornMemoryWatcher
(NashornScriptCallable nashornScriptCallable, Future<Object> scriptTask, long wait, TimeUnit unit, long maxMemoryUsage, boolean debug, Writer errorWriter) Creates a new memory watcher -
Method Summary
-
Constructor Details
-
NashornMemoryWatcher
public NashornMemoryWatcher(NashornScriptCallable nashornScriptCallable, Future<Object> scriptTask, long wait, TimeUnit unit, long maxMemoryUsage, boolean debug, Writer errorWriter) Creates a new memory watcher- Parameters:
nashornScriptCallable
- the script callable to be watchedscriptTask
- the script task to get the thread ofwait
- how long to wait until the next checkunit
- unit until the next checkmaxMemoryUsage
- how much memory should be used as a maximumdebug
- if debug is enablederrorWriter
- the error writer to output some information
-
-
Method Details