import org.simantics.scl.compiler.top.SCLExpressionCompilationException;
import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.compiler.types.Types;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class MemoryLeakExperiment {
+ private static final Logger LOGGER = LoggerFactory.getLogger(MemoryLeakExperiment.class);
ModuleRepository moduleRepository;
EnvironmentSpecification environmentSpecification;
getClass().getClassLoader());
} catch(ImportFailureException e) {
for(ImportFailure failure : e.failures)
- System.err.println("Failed to import " + failure.moduleName);
+ LOGGER.warn("Failed to import " + failure.moduleName);
throw e;
}
if(expectedValue != null)
Assert.assertEquals(expectedValue, result);
} catch(SCLExpressionCompilationException e) {
- System.out.println(CompilationErrorFormatter.toString(expressionText, e.getErrors()));
+ LOGGER.error(CompilationErrorFormatter.toString(expressionText, e.getErrors()));
throw e;
}
}
System.gc();
Thread.sleep(100L);
double used = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory());
- System.out.println(i + " " + used*1e-6 + " Mb, " + (used / i) + " b / expression");
+ LOGGER.info(i + " " + used*1e-6 + " Mb, " + (used / i) + " b / expression");
}
}
}