EclipseMemoryAnalyzer

用Eclipse Memory Analyzer查看 抽象类属性 技巧

拜拜、爱过 提交于 2019-11-28 23:18:58
早上看到spring代码中有有缓存bean的Map如下: public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanRegistry { /** Cache of singleton objects created by FactoryBeans: FactoryBean name --> object */ private final Map<String, Object> factoryBeanObjectCache = new ConcurrentHashMap<String, Object>(); 如果想找到 factoryBeanObjectCache 这个Map,但是 FactoryBeanRegistrySupport 是抽象的,发现OQL这样写可以查询出来,还是非常方便; SELECT s FROM INSTANCEOF org.springframework.beans.factory.support.FactoryBeanRegistrySupport s 这样就查出来org.springframework.beans.factory.support.DefaultListableBeanFactory 这样的对象,然后用outgoing refences