memory leak with spring ConfigurableApplicationContext
问题 public class Tasker{ ConfigurableApplicationContext context ; public void load(){ context = = loadSpringContext(); } pulic void doSomething(){ //do something } public void close(){ context.close(); } } public class Caller extends Thread { public void run(){ Tasker tasker = new Tasker(); try{ tasker.load(); tasker.doSomething(); }finally(){ tasket.close(); } } } //sample driver code which is not in my control Caller caller = new Caller() caller.start(); caller.stop(); Now the problem is if