它们可能不去清除一些对象和类,因为它们假定当程序存在时,虚拟机也存在,所有对象和类都将被自动清除。
Some objects and classes may not be cleaned up because they assume that once the program exits, the virtual machine will exit too, and everything will be cleaned up automatically.
原因在于多个虚拟机都可以涉及到相同的单实例类,这些单实例对象可能会同时存在于上下文中,从而导致这些单实例对象并不是全局唯一的。
The instance fields of the singleton will not be globally unique. Because several VMs are involved for what appears to be the same object, several singleton objects might be brought into existence.
当单例类的副本运行于多个虚拟机中时,每个虚拟机都会为其创建一个实例对象。
When copies of the singleton class run in multiple VMs, an instance is created for each machine.
应用推荐