Commit 1e09195c authored by Noric Couderc's avatar Noric Couderc

Made DYNCLASSLOADER an instance field of BenchmarkGenerator

Having a static DYNCLASSLOADER prevented some garbage collection,
causing memory leaks.
parent d7cc1da7
......@@ -55,6 +55,7 @@ public abstract class BenchmarkGenerator<S> {
private S state_override = null;
public BenchmarkGenerator(int initial_size, MethodSelectionStrategy mst) {
this.DYNCLASSLOADER = new DynamicClassLoader();
this.initial_size = initial_size;
this.method_selector = mst;
this.method_selector_style = mst.getSelectionType();
......@@ -81,6 +82,7 @@ public abstract class BenchmarkGenerator<S> {
*/
public
BenchmarkGenerator(int data_size, MethodSelectionType mst) {
this.DYNCLASSLOADER = new DynamicClassLoader();
this.initial_size = data_size;
this.method_selector_style= mst;
this.method_selector = null; // Will be set when needed
......@@ -564,7 +566,7 @@ public abstract class BenchmarkGenerator<S> {
}
// TODO: This object might cause memory problems if it's never garbage collected.
private static final DynamicClassLoader DYNCLASSLOADER = new DynamicClassLoader();
private DynamicClassLoader DYNCLASSLOADER = null;
public static class DynamicClassLoader extends ClassLoader {
public Class<?> define(String className, byte[] bytecode) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment