Web应用程序[ROOT]似乎已启动名为[pollingConfigurationSource]的线程,但未能停止该线程。内存泄漏

时间:2018-10-15 06:29:11

标签: postgresql spring-boot liquibase

嗨,我在运行项目时遇到内存泄漏错误。我正在使用spring boot + quards scheduler + liquibase + postgreSQL 9.6。这些是我们正在使用的技术。

错误:

12018-10-15 11:43:19.005  WARN [billing,,,] 19152 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [pollingConfigurationSource] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
         java.lang.Thread.run(Thread.java:748)

我的配置代码是:

package com.xyz.api;

@Slf4j
@XyzService
@EnableWebSecurity
@EnableResourceServer
@EnableGlobalMethodSecurity( prePostEnabled = true )
public class BApplication extends ResourceServerConfigurerAdapter implements WebMvcConfigurer
{
    public static void main( String[] args )
    {
        SpringApplication.run( BApplication.class, args );
    }

    @Override
    public void configure( ResourceServerSecurityConfigurer resources )
    {
        resources.resourceId( "xxxx" );
    }

    @Override
    public void configure( HttpSecurity http ) throws Exception
    {
        http.authorizeRequests()
            .antMatchers( "/" ).permitAll()
            .antMatchers( "/docs/**" ).permitAll()
            .antMatchers( "/actuator/health" ).permitAll() // can we tighten this up?
            .anyRequest().authenticated(); //individual services use annotations
    }

    @Override
    public void addViewControllers( ViewControllerRegistry registry )
    {
        registry.addViewController( "/" ).setViewName( "forward:/docs/index.html" );
    }

    @Bean
    public Clock clock()
    {
        return Clock.systemUTC();
    }

    @Bean
    public RestTemplate restTemplate( RestTemplateBuilder builder )
    {
        return builder.build();
    }
}

实际上,这可以更早地完成工作,但突然在部署时出现错误。帮我解决这个问题。

我还提到了:Memory Leak Issue with spring-cloud-starter-hystrix and spring-cloud-starter-archaius integration 但没有得到任何解决方案。

0 个答案:

没有答案