The web application [ROOT] appears to have started a thread named [pollingConfigurationSource] but has failed to stop it. Memory leak
Asked Answered
R

0

3

Hi i am getting memory leak error while running project. I am using spring boot + quards scheduler + liquibase + postgreSQL 9.6. These are technologies we are using.

Error:

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)

and my configuration code is:

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();
    }
}

Actually this work fine earlier but suddenly it give error at deployment. Help me out to solve this issue.

I also referred: Memory Leak Issue with spring-cloud-starter-hystrix and spring-cloud-starter-archaius integration But not getting any solution on this.

Renfrow answered 15/10, 2018 at 6:29 Comment(3)
You seem to be using Spring Cloud Netflix? Leak is produced by Archaius. Have a look here, where they explain the issue: #49126578Roturier
Possible duplicate of Memory Leak Issue with spring-cloud-starter-hystrix and spring-cloud-starter-archaius integrationRoturier
@MagdKudama I am not using Netflix in our project.Renfrow

© 2022 - 2024 — McMap. All rights reserved.