The most common source of unintentional object retention is the use of a Map to associate metadata with transient objects.
无意识对象保留最常见的原因是使用 Map 将元数据与临时对象(transient object)相关联。
For example, last time we saw how failing to demarcate an object's lifecycle could cause unintentional object retention when trying to associate metadata with transient objects.
例如,上一次我们看到了,不能划分对象的生命周期会导致,在试图将元数据关联到瞬时对象时出现意外的对象保持。
There are a number of considerations (versioning, transient objects, Enum constants, etc.) when using object serialization, so I would suggest you do some reading about the subject.
有多方面的考虑(版本控制,瞬时对象,枚举常量时,使用对象序列化等),所以我建议做一些阅读的主题。
应用推荐