Extended default collection size for common per-bean caches
Issue: SPR-13621
This commit is contained in:
parent
7b711c4aac
commit
98be36a306
|
|
@ -37,7 +37,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
|
|||
|
||||
protected boolean beforeExistingAdvisors = false;
|
||||
|
||||
private final Map<Class<?>, Boolean> eligibleBeans = new ConcurrentHashMap<Class<?>, Boolean>(64);
|
||||
private final Map<Class<?>, Boolean> eligibleBeans = new ConcurrentHashMap<Class<?>, Boolean>(256);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -129,13 +129,13 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
|
|||
private ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
private final Set<String> lookupMethodsChecked =
|
||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(64));
|
||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(256));
|
||||
|
||||
private final Map<Class<?>, Constructor<?>[]> candidateConstructorsCache =
|
||||
new ConcurrentHashMap<Class<?>, Constructor<?>[]>(64);
|
||||
new ConcurrentHashMap<Class<?>, Constructor<?>[]>(256);
|
||||
|
||||
private final Map<String, InjectionMetadata> injectionMetadataCache =
|
||||
new ConcurrentHashMap<String, InjectionMetadata>(64);
|
||||
new ConcurrentHashMap<String, InjectionMetadata>(256);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class InitDestroyAnnotationBeanPostProcessor
|
|||
private int order = Ordered.LOWEST_PRECEDENCE;
|
||||
|
||||
private transient final Map<Class<?>, LifecycleMetadata> lifecycleMetadataCache =
|
||||
new ConcurrentHashMap<Class<?>, LifecycleMetadata>(64);
|
||||
new ConcurrentHashMap<Class<?>, LifecycleMetadata>(256);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
|||
|
||||
/** Cache of filtered PropertyDescriptors: bean Class -> PropertyDescriptor array */
|
||||
private final ConcurrentMap<Class<?>, PropertyDescriptor[]> filteredPropertyDescriptorsCache =
|
||||
new ConcurrentHashMap<Class<?>, PropertyDescriptor[]>(64);
|
||||
new ConcurrentHashMap<Class<?>, PropertyDescriptor[]>(256);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -161,10 +161,11 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
|||
|
||||
/** Map from bean name to merged RootBeanDefinition */
|
||||
private final Map<String, RootBeanDefinition> mergedBeanDefinitions =
|
||||
new ConcurrentHashMap<String, RootBeanDefinition>(64);
|
||||
new ConcurrentHashMap<String, RootBeanDefinition>(256);
|
||||
|
||||
/** Names of beans that have already been created at least once */
|
||||
private final Set<String> alreadyCreated = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(64));
|
||||
private final Set<String> alreadyCreated =
|
||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(256));
|
||||
|
||||
/** Names of beans that are currently in creation */
|
||||
private final ThreadLocal<Object> prototypesCurrentlyInCreation =
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
|||
private final Map<Class<?>, Object> resolvableDependencies = new ConcurrentHashMap<Class<?>, Object>(16);
|
||||
|
||||
/** Map of bean definition objects, keyed by bean name */
|
||||
private final Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<String, BeanDefinition>(64);
|
||||
private final Map<String, BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<String, BeanDefinition>(256);
|
||||
|
||||
/** Map of singleton and non-singleton bean names, keyed by dependency type */
|
||||
private final Map<Class<?>, String[]> allBeanNamesByType = new ConcurrentHashMap<Class<?>, String[]>(64);
|
||||
|
|
@ -167,7 +167,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
|||
private final Map<Class<?>, String[]> singletonBeanNamesByType = new ConcurrentHashMap<Class<?>, String[]>(64);
|
||||
|
||||
/** List of bean definition names, in registration order */
|
||||
private volatile List<String> beanDefinitionNames = new ArrayList<String>(64);
|
||||
private volatile List<String> beanDefinitionNames = new ArrayList<String>(256);
|
||||
|
||||
/** List of names of manually registered singletons, in registration order */
|
||||
private volatile Set<String> manualSingletonNames = new LinkedHashSet<String>(16);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
|
|||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
/** Cache of singleton objects: bean name --> bean instance */
|
||||
private final Map<String, Object> singletonObjects = new ConcurrentHashMap<String, Object>(64);
|
||||
private final Map<String, Object> singletonObjects = new ConcurrentHashMap<String, Object>(256);
|
||||
|
||||
/** Cache of singleton factories: bean name --> ObjectFactory */
|
||||
private final Map<String, ObjectFactory<?>> singletonFactories = new HashMap<String, ObjectFactory<?>>(16);
|
||||
|
|
@ -92,7 +92,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
|
|||
private final Map<String, Object> earlySingletonObjects = new HashMap<String, Object>(16);
|
||||
|
||||
/** Set of registered singletons, containing the bean names in registration order */
|
||||
private final Set<String> registeredSingletons = new LinkedHashSet<String>(64);
|
||||
private final Set<String> registeredSingletons = new LinkedHashSet<String>(256);
|
||||
|
||||
/** Names of beans that are currently in creation */
|
||||
private final Set<String> singletonsCurrentlyInCreation =
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
|
|||
private transient BeanFactory beanFactory;
|
||||
|
||||
private transient final Map<String, InjectionMetadata> injectionMetadataCache =
|
||||
new ConcurrentHashMap<String, InjectionMetadata>(64);
|
||||
new ConcurrentHashMap<String, InjectionMetadata>(256);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ class PostProcessorRegistrationDelegate {
|
|||
|
||||
private final AbstractApplicationContext applicationContext;
|
||||
|
||||
private final Map<String, Boolean> singletonNames = new ConcurrentHashMap<String, Boolean>(64);
|
||||
private final Map<String, Boolean> singletonNames = new ConcurrentHashMap<String, Boolean>(256);
|
||||
|
||||
public ApplicationListenerDetector(AbstractApplicationContext applicationContext) {
|
||||
this.applicationContext = applicationContext;
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ public class PersistenceAnnotationBeanPostProcessor
|
|||
private transient ListableBeanFactory beanFactory;
|
||||
|
||||
private transient final Map<String, InjectionMetadata> injectionMetadataCache =
|
||||
new ConcurrentHashMap<String, InjectionMetadata>(64);
|
||||
new ConcurrentHashMap<String, InjectionMetadata>(256);
|
||||
|
||||
private final Map<Object, EntityManager> extendedEntityManagersToClose =
|
||||
new ConcurrentHashMap<Object, EntityManager>(16);
|
||||
|
|
|
|||
Loading…
Reference in New Issue