gpt4 book ai didi

java - spring ldap内存不足无法创建新的 native 线程

转载 作者:行者123 更新时间:2023-12-01 16:02:24 24 4
gpt4 key购买 nike

HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Filter execution threw an exception


root cause

java.lang.OutOfMemoryError: unable to create new native thread
java.lang.Thread.start0(Native Method)
java.lang.Thread.start(Thread.java:597)
com.sun.jndi.ldap.Connection.<init>(Connection.java:215)
com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:118)
com.sun.jndi.ldap.LdapClientFactory.createPooledConnection(LdapClientFactory.java:46)
com.sun.jndi.ldap.pool.Connections.<init>(Connections.java:97)
com.sun.jndi.ldap.pool.Pool.getPooledConnection(Pool.java:114)
com.sun.jndi.ldap.LdapPoolManager.getLdapClient(LdapPoolManager.java:310)
com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1572)
com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2625)
com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:288)
com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
javax.naming.InitialContext.init(InitialContext.java:223)
javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:134)
org.springframework.ldap.core.support.LdapContextSource.getDirContextInstance(LdapContextSource.java:43)
org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:254)
org.springframework.ldap.core.support.AbstractContextSource.getContext(AbstractContextSource.java:106)
org.springframework.ldap.core.LdapTemplate.authenticate(LdapTemplate.java:1434)
org.springframework.ldap.core.LdapTemplate.authenticate(LdapTemplate.java:1386)
com.company.iss.services.ISSServiceImpl.login(ISSServiceImpl.java:98)
sun.reflect.GeneratedMethodAccessor358.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy55.login(Unknown Source)
sun.reflect.GeneratedMethodAccessor358.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy56.login(Unknown Source)
com.company.iss.services.UserDetailsAuthenticationProvider.retrieveUser(UserDetailsAuthenticationProvider.java:51)
org.springframework.security.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:121)
org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:188)
org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46)
org.springframework.security.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:82)
org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:258)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.

这是我的 Spring LDAP 设置

<property name="baseEnvironmentProperties">
<props>
<prop key="com.sun.jndi.ldap.connect.pool">true</prop>
<prop key="com.sun.jndi.ldap.connect.pool.initsize">1</prop>
<prop key="com.sun.jndi.ldap.connect.pool.maxsize">1</prop>
<prop key="com.sun.jndi.ldap.connect.pool.prefsize">1</prop>
<prop key="com.sun.jndi.ldap.connect.pool.timeout">300000</prop>
</props>
</property>

任何评论为什么会导致内存不足?我的池大小只有 1?

最佳答案

我怀疑它与 LDAP 或您的池大小有任何关系。烫发一代可能会被填满。我会打开 VisualVM 并观察应用程序启动时内存发生的情况,看看情况是否如此。

我还会检查 Tomcat 日志,看看是否有比此堆栈跟踪更多、更好的信息。

关于java - spring ldap内存不足无法创建新的 native 线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3500883/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com