I have an application that is working on tomcat8 , on repeated undeploy/deploy (i use parallel versions) i noticed that the server memory increase also on tomacat manager clicking on find leaks shows the below
The following web applications were stopped (reloaded, undeployed),
but their classes from previous runs are still loaded in memory, thus
causing a memory leak (use a profiler to confirm): /
i tried to use profiler to check what is still in memory but could not figure out , as i did not know where to start with .
stopping the application show the below log
2016-11-03 05:50:25.388 [ ] INFO 29986 --- [http-nio-8080-exec-34] o.a.c.c.C.[.[.teltacworldwide.co].[/] : Destroying Spring FrameworkServlet 'dispatcherServlet'
2016-11-03 05:50:25.392 [ ] INFO 29986 --- [http-nio-8080-exec-34] o.a.c.c.C.[.[.teltacworldwide.co].[/] : Closing Spring root WebApplicationContext
2016-11-03 05:50:25.393 [ ] INFO 29986 --- [http-nio-8080-exec-34] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#7fe83fea: startup date [Wed Nov 02 15:09:26 GMT 2016]; root of context hierarchy
2016-11-03 05:50:25.403 [ ] INFO 29986 --- [http-nio-8080-exec-34] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483647
2016-11-03 05:50:25.411 [ ] INFO 29986 --- [http-nio-8080-exec-34] o.s.m.s.s.StompBrokerRelayMessageHandler : Stopping...
2016-11-03 05:50:25.412 [ ] INFO 29986 --- [http-nio-8080-exec-34] o.s.m.s.s.StompBrokerRelayMessageHandler : BrokerAvailabilityEvent[available=false, StompBrokerRelay[192.168.70.149:61613]]
2016-11-03 05:50:25.465 [ ] WARN 29986 --- [globalEventExecutor-1-2] io.netty.channel.AbstractChannel : Can't invoke task later as EventLoop rejected it
java.util.concurrent.RejectedExecutionException: event executor terminated
at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:715) ~[netty-all-4.0.31.Final.jar:4.0.31.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:300) ~[netty-all-4.0.31.Final.jar:4.0.31.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:691) ~[netty-all-4.0.31.Final.jar:4.0.31.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.invokeLater(AbstractChannel.java:826) [netty-all-4.0.31.Final.jar:4.0.31.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$800(AbstractChannel.java:378) [netty-all-4.0.31.Final.jar:4.0.31.Final]
at io.netty.channel.AbstractChannel$AbstractUnsafe$5.run(AbstractChannel.java:571) [netty-all-4.0.31.Final.jar:4.0.31.Final]
at io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEventExecutor.java:233) [netty-all-4.0.31.Final.jar:4.0.31.Final]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [netty-all-4.0.31.Final.jar:4.0.31.Final]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
Related
We have a bunch of spring boot servers and they are different code base (but all cloned from the same base)
They all went down last night, at slightly different time. When I looked at the log, it didn't say much. Here is the log
2021-08-06 06:22:09.735 INFO 1 --- [ Thread-4] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'threadPoolTaskScheduler'
2021-08-06 06:22:09.747 INFO 1 --- [ Thread-4] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-08-06 06:22:09.750 INFO 1 --- [ Thread-4] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-08-06 06:22:09.761 INFO 1 --- [ Thread-4] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Here is the log from another project we have
2021-08-06 06:36:39.317 INFO 1 --- [ Thread-3] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler'
2021-08-06 06:36:39.324 INFO 1 --- [ Thread-3] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-08-06 06:36:39.329 INFO 1 --- [ Thread-3] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-08-06 06:36:39.341 INFO 1 --- [ Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2021-08-06 06:36:39.354 INFO 1 --- [ Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
What could be the reason and how do I troubleshoot this?
The springboot runs inside a docker image, running on ubuntu.
The servers were able to be rebooted immediately without issue.
2021-04-27 00:27:46.292 WARN 74300 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-04-27 00:27:46.698 INFO 74300 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-04-27 00:27:47.531 INFO 74300 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2021-04-27 00:27:47.591 INFO 74300 --- [ main] c.s.h.MyApp : Started MyApp in 20.68 seconds (JVM running for 24.132)
What does mean INFO 74300? INFO is log level but what does mean integer next no it? It changes at every running.
That's the PID (Process Identifier)
I have stated my application then it got shut down after 2 hours automatically and there no logs which tell me the reason. Can anyone help me regarding this? I didn't hit any rest end point but it gets shutdown automatically.
Please find sample logs below.
2018-08-31 17:47:48.099 INFO 18278 --- [main]
c.p.c2i.fulfillment.app.Application : Started Application in
8.936 seconds (JVM running for 9.6)
2018-08-31 20:01:18.904 INFO 18278 --- [Thread-3] ConfigServletWebServerApplicationContext : Closing
org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#5ecddf8f:
startup date [Fri Aug 31 17:47:40 IST 2018]; root of context
hierarchy
2018-08-31 20:01:18.907 INFO 18278 --- [Thread-3] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed
beans on shutdown
2018-08-31 20:01:18.909 INFO 18278 --- [Thread-3] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed
beans
2018-08-31 20:01:18.912 INFO 18278 --- [Thread-3] j.LocalContainerEntityManagerFactoryBean : Closing JPA
EntityManagerFactory for persistence unit 'default'
2018-08-31 20:01:18.913 INFO 18278 --- [Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown
initiated...
2018-08-31 20:01:18.925 INFO 18278 --- [Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown
completed.
I am newbie to Spring, I have written a spring application. when I try to start the application its giving me below logs but application being shutdown.
could you please help me anyone if i am doing something wrong here ?
2017-06-01 16:39:27.187 INFO 6040 --- [ main] com.slb.sims.flows.Application : Starting Application on SLB-25QDSY1 with PID 6040 (D:\SLB\SpringPOCs\prjSpringJDBCWS\target\classes started by LTangirala in D:\SLB\SpringPOCs\prjSpringJDBCWS)
2017-06-01 16:39:27.191 INFO 6040 --- [ main] com.slb.sims.flows.Application : No active profile set, falling back to default profiles: default
2017-06-01 16:39:27.313 INFO 6040 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#2c34f934: startup date [Thu Jun 01 16:39:27 CDT 2017]; root of context hierarchy
2017-06-01 16:39:28.448 INFO 6040 --- [ main] o.s.c.s.ClassPathXmlApplicationContext : Refreshing org.springframework.context.support.ClassPathXmlApplicationContext#2f16c6b3: startup date [Thu Jun 01 16:39:28 CDT 2017]; root of context hierarchy
2017-06-01 16:39:28.452 INFO 6040 --- [ main] o.s.b.f.xml.XmlBeanDefinitionReader : Loading XML bean definitions from class path resource [applicationContext.xml]
2017-06-01 16:39:28.592 INFO 6040 --- [ main] o.s.j.d.DriverManagerDataSource : Loaded JDBC driver: com.mysql.jdbc.Driver
2017-06-01 16:39:29.080 INFO 6040 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2017-06-01 16:39:29.095 INFO 6040 --- [ main] com.slb.sims.flows.Application : Started Application in 2.342 seconds (JVM running for 3.083)
2017-06-01 16:39:29.096 INFO 6040 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext#2c34f934: startup date [Thu Jun 01 16:39:27 CDT 2017]; root of context hierarchy
2017-06-01 16:39:29.098 INFO 6040 --- [ Thread-2] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
Picked up _JAVA_OPTIONS: -Xmx1024M
it doesn't have an embedded server like Tomcat in classpath. add it and it will fix the issue
for MAVEN add this dependancy in pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
for Gradle (build.gradle) add
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
}
You need to add this dependency to your pom.xml.
After that it should work.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
I am running a spring-boot application and everything is good except when i try to close it. I got error on the below code
while (true) {
try {
if(level2List == null)
break;
CDR cdr = level2List.poll(2, TimeUnit.SECONDS);
The error is generated on the last line , spring boot is shutting down level2List before the 2 second wait is done as below
2015-05-29 17:32:15.758 INFO 27390 --- [ Thread-1] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#358ee631: startup date [Fri May 29 17:31:17 GMT 2015]; root of context hierarchy
2015-05-29 17:32:15.765 INFO 27390 --- [ Thread-1] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2015-05-29 17:32:15.766 INFO 27390 --- [ Thread-1] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans
2015-05-29 17:32:15.780 INFO 27390 --- [ Thread-1] o.s.c.ehcache.EhCacheManagerFactoryBean : Shutting down EhCache CacheManager
2015-05-29 17:32:15.804 INFO 27390 --- [ Thread-1] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'level2ES'
2015-05-29 17:32:15.815 INFO 27390 --- [ Thread-1] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'level1ES'
2015-05-29 17:32:15.823 INFO 27390 --- [ Thread-1] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2015-05-29 17:32:15.825 INFO 27390 --- [ Thread-1] com.jolbox.bonecp.BoneCP : Shutting down connection pool...
2015-05-29 17:32:15.833 INFO 27390 --- [ Thread-1] com.jolbox.bonecp.BoneCP : Connection pool has been shutdown.
2015-05-29 17:32:15.848 ERROR 27390 --- [pool-2-thread-1] c.t.t.c.process.CDRDataBase : Error
java.lang.InterruptedException: null
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2014)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2088)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at com.teltacworldwide.tekram.cdrserver.process.CDRDataBaseNative.run(CDRDataBaseNative.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Is there any way to order the shutting down process or to make sure I am not using level2List before shutting it down?
BR
Shahbour
I did two things
add
#Bean(destroyMethod = "shutdown")
public ThreadPoolTaskExecutor level1ES() {
also
} catch (InterruptedException e) {
log.warn("Closing application while CDR still in queue"); }
BR
Shahbour