mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-26 07:35:39 +00:00
Unset script engine variables after scripts complete, allowing memory to be freed up sooner - see also r7252
* ScriptResource.java, ActionDirectory.java, ScriptedDecideRule.java
This commit is contained in:
@@ -324,7 +324,10 @@ public class ActionDirectory implements ApplicationContextAware, Lifecycle, Runn
|
||||
ex = e;
|
||||
} catch (RuntimeException e) {
|
||||
ex = e;
|
||||
}
|
||||
} finally {
|
||||
engine.put("rawOut", null);
|
||||
engine.put("appCtx", null);
|
||||
}
|
||||
|
||||
// report output/exception to files paired with script in done dir
|
||||
rawOut.flush();
|
||||
|
||||
@@ -112,6 +112,12 @@ public class ScriptResource extends JobRelatedResource {
|
||||
rawOutput = rawString.toString();
|
||||
htmlOut.flush();
|
||||
htmlOutput = htmlString.toString();
|
||||
|
||||
eng.put("rawOut", null);
|
||||
eng.put("htmlOut", null);
|
||||
eng.put("job", null);
|
||||
eng.put("appCtx", null);
|
||||
eng.put("scriptResource", null);
|
||||
}
|
||||
//TODO: log script, results somewhere; job log INFO?
|
||||
|
||||
|
||||
@@ -132,7 +132,9 @@ implements ApplicationContextAware, InitializingBean {
|
||||
} catch (ScriptException e) {
|
||||
logger.log(Level.WARNING,e.getMessage(),e);
|
||||
return DecideResult.NONE;
|
||||
}
|
||||
} finally {
|
||||
engine.put("object", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user