我有一个运行 iPojo 1.12.1 的 OSGi Java 8 项目,
我使用工厂通过 createComponentInstance 方法创建 InstanceManager。一旦我完成了 InstanceManager,我就会调用它。我希望内存被释放,但该对象仍然有来自其他 iPojo 对象的强引用。
Factory myFactory; // Get the factory
InstanceManager instance = (InstanceManager) myFactory.createComponentInstance(null); // Get an instance
Object myObject = instance.getPojoObject(); // Retrieve the actual object
// Do something with the object.
myObject = null; // remove all reference to the object
instance.dispose(); // Dispose of the instance manager.
instance = null; // Remove my strong reference to the instance.
清理时我缺少什么吗?