JVM調優實戰--自己的小項目優化過程


90%的項目都不需要調優,除非是達到了京東天貓級別的網站訪問量和併發量,其他的視情況而定,一般都是自己的代碼問題,能優化代碼的儘量優化代碼

啓動優化:

第一次啓動:

[GC (Allocation Failure) [PSYoungGen: 65024K->7481K(75776K)] 65024K->7497K(249344K), 0.0081849 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.2.RELEASE)

2020-04-26 10:24:32.176  INFO 20188 --- [           main] com.sxj.seed.SeedApplication             : Starting SeedApplication on DESKTOP-C0UPCFC with PID 20188 (E:\seed\target\classes started by zx in E:\seed)
2020-04-26 10:24:32.180  INFO 20188 --- [           main] com.sxj.seed.SeedApplication             : No active profile set, falling back to default profiles: default
[GC (Allocation Failure) [PSYoungGen: 72505K->10046K(75776K)] 72521K->10070K(249344K), 0.0145282 secs] [Times: user=0.03 sys=0.00, real=0.01 secs] 
[GC (Metadata GC Threshold) [PSYoungGen: 31795K->7035K(75776K)] 31819K->7067K(249344K), 0.0076316 secs] [Times: user=0.05 sys=0.00, real=0.01 secs] 
[Full GC (Metadata GC Threshold) [PSYoungGen: 7035K->0K(75776K)] [ParOldGen: 32K->6872K(89088K)] 7067K->6872K(164864K), [Metaspace: 20433K->20431K(1067008K)], 0.0279852 secs] [Times: user=0.02 sys=0.02, real=0.03 secs] 
2020-04-26 10:24:32.913  INFO 20188 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
2020-04-26 10:24:32.939  INFO 20188 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 20ms. Found 0 JDBC repository interfaces.
[GC (Allocation Failure) [PSYoungGen: 65024K->6943K(118784K)] 71896K->13824K(207872K), 0.0049525 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
2020-04-26 10:24:33.184  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'userShiroConfig' of type [com.sxj.seed.shiro.UserShiroConfig$$EnhancerBySpringCGLIB$$50df6c4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.190  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.251  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties' of type [org.mybatis.spring.boot.autoconfigure.MybatisProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.256  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration' of type [org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$c5a4bf2b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.259  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure' of type [com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure$$EnhancerBySpringCGLIB$$ac7c636d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.261  INFO 20188 --- [           main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
2020-04-26 10:24:33.315  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.319  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.druid.spring.boot.autoconfigure.stat.DruidFilterConfiguration' of type [com.alibaba.druid.spring.boot.autoconfigure.stat.DruidFilterConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.341  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'statFilter' of type [com.alibaba.druid.filter.stat.StatFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.419  INFO 20188 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
2020-04-26 10:24:33.419  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.438  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.681  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.688  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionTemplate' of type [org.mybatis.spring.SqlSessionTemplate] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.689  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminDao' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.691  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminDao' of type [com.sun.proxy.$Proxy68] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.692  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminService' of type [com.sxj.seed.service.impl.AdminServiceImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.692  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'userRealm' of type [com.sxj.seed.shiro.UserRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:24:33.836  INFO 20188 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[GC (Allocation Failure) [PSYoungGen: 118559K->10737K(137216K)] 125440K->19071K(226304K), 0.0087021 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
[GC (Metadata GC Threshold) [PSYoungGen: 23560K->8722K(201216K)] 31894K->17064K(290304K), 0.0049020 secs] [Times: user=0.02 sys=0.00, real=0.01 secs] 
[Full GC (Metadata GC Threshold) [PSYoungGen: 8722K->0K(201216K)] [ParOldGen: 8341K->14171K(123392K)] 17064K->14171K(324608K), [Metaspace: 33954K->33954K(1079296K)], 0.0310137 secs] [Times: user=0.03 sys=0.00, real=0.03 secs] 
2020-04-26 10:24:34.064  INFO 20188 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 80 (http)
2020-04-26 10:24:34.072  INFO 20188 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-04-26 10:24:34.072  INFO 20188 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.29]
2020-04-26 10:24:34.177  INFO 20188 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-04-26 10:24:34.177  INFO 20188 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1946 ms
2020-04-26 10:24:34.381  INFO 20188 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-04-26 10:24:34.433  INFO 20188 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2020-04-26 10:24:34.630  INFO 20188 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 80 (http) with context path ''
2020-04-26 10:24:34.632  INFO 20188 --- [           main] com.sxj.seed.SeedApplication             : Started SeedApplication in 2.819 seconds (JVM running for 4.691)

在這裏插入圖片描述
在這裏插入圖片描述
能看到啓動的時候就進行了兩次FullGC,
想要優化就是儘量減少FullGC的次數,GC的時間和次數足夠少,

第一次FullGC的情況:
[Full GC (Metadata GC Threshold) [PSYoungGen: 7142K->0K(75776K)] [ParOldGen: 32K->6991K(89600K)] 7174K->6991K(165376K), [Metaspace: 20527K->20525K(1067008K)], 0.0226215 secs] [Times: user=0.11 sys=0.00, real=0.02 secs]
第二次FullGC的情況:
[Full GC (Metadata GC Threshold) [PSYoungGen: 9828K->0K(196608K)] [ParOldGen: 7079K->14796K(138240K)] 16908K->14796K(334848K), [Metaspace: 33872K->33872K(1079296K)], 0.0363551 secs] [Times: user=0.09 sys=0.00, real=0.04 secs]
能看到Metaspace也就是元空間,同時也能明顯的看到YGC的針對元空間來的
先記錄一下第一次沒有調整前的啓動時間:
2020-04-26 01:57:12.178 INFO 3884 — [ main] com.sxj.seed.SeedApplication : Started SeedApplication in 3.176 seconds (JVM running for 5.618)
然後對元空間進行一個調整:
增大元空間
-XX:MetaspaceSize=64m
再次啓動:

[GC (Allocation Failure) [PSYoungGen: 65024K->7523K(75776K)] 65024K->7539K(249344K), 0.0067602 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.2.RELEASE)

2020-04-26 10:20:11.556  INFO 6820 --- [           main] com.sxj.seed.SeedApplication             : Starting SeedApplication on DESKTOP-C0UPCFC with PID 6820 (E:\seed\target\classes started by zx in E:\seed)
2020-04-26 10:20:11.558  INFO 6820 --- [           main] com.sxj.seed.SeedApplication             : No active profile set, falling back to default profiles: default
[GC (Allocation Failure) [PSYoungGen: 72547K->9898K(75776K)] 72563K->9922K(249344K), 0.0096701 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
[GC (Allocation Failure) [PSYoungGen: 74922K->10734K(75776K)] 74946K->11299K(249344K), 0.0064536 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
2020-04-26 10:20:12.126  INFO 6820 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
2020-04-26 10:20:12.147  INFO 6820 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 17ms. Found 0 JDBC repository interfaces.
2020-04-26 10:20:12.395  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'userShiroConfig' of type [com.sxj.seed.shiro.UserShiroConfig$$EnhancerBySpringCGLIB$$8d293afc] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.402  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.458  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties' of type [org.mybatis.spring.boot.autoconfigure.MybatisProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.464  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration' of type [org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$4dc00363] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.466  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure' of type [com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure$$EnhancerBySpringCGLIB$$3497a7a5] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.469  INFO 6820 --- [           main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
2020-04-26 10:20:12.520  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.524  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.druid.spring.boot.autoconfigure.stat.DruidFilterConfiguration' of type [com.alibaba.druid.spring.boot.autoconfigure.stat.DruidFilterConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.549  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'statFilter' of type [com.alibaba.druid.filter.stat.StatFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[GC (Allocation Failure) [PSYoungGen: 75758K->10739K(140800K)] 76323K->14068K(314368K), 0.0104284 secs] [Times: user=0.02 sys=0.00, real=0.01 secs] 
2020-04-26 10:20:12.615  INFO 6820 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
2020-04-26 10:20:12.615  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.625  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.848  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.852  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionTemplate' of type [org.mybatis.spring.SqlSessionTemplate] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.853  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminDao' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.854  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminDao' of type [com.sun.proxy.$Proxy68] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.854  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminService' of type [com.sxj.seed.service.impl.AdminServiceImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.855  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'userRealm' of type [com.sxj.seed.shiro.UserRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:12.989  INFO 6820 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 10:20:13.168  INFO 6820 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 80 (http)
2020-04-26 10:20:13.175  INFO 6820 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-04-26 10:20:13.176  INFO 6820 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.29]
2020-04-26 10:20:13.278  INFO 6820 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-04-26 10:20:13.278  INFO 6820 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1674 ms
2020-04-26 10:20:13.504  INFO 6820 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
[GC (Allocation Failure) [PSYoungGen: 140787K->10746K(140800K)] 144116K->24838K(314368K), 0.0118364 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
2020-04-26 10:20:13.571  INFO 6820 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2020-04-26 10:20:13.807  INFO 6820 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 80 (http) with context path ''
2020-04-26 10:20:13.809  INFO 6820 --- [           main] com.sxj.seed.SeedApplication             : Started SeedApplication in 2.632 seconds (JVM running for 4.449)

能看到已經沒有FullGC了,並且YGC也沒有針對元空間進行回收,啓動時間也縮短了,同時也能看到GC的次數減少了,只有三次了,

再優化一下,設置起始堆的大小:-Xms1000m
啓動:


 .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.2.RELEASE)

2020-04-26 14:37:18.799  INFO 12360 --- [           main] com.sxj.seed.SeedApplication             : Starting SeedApplication on DESKTOP-C0UPCFC with PID 12360 (E:\seed\target\classes started by zx in E:\seed)
2020-04-26 14:37:18.801  INFO 12360 --- [           main] com.sxj.seed.SeedApplication             : No active profile set, falling back to default profiles: default
2020-04-26 14:37:19.366  INFO 12360 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
2020-04-26 14:37:19.387  INFO 12360 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 17ms. Found 0 JDBC repository interfaces.
[GC (Allocation Failure) [PSYoungGen: 256000K->22763K(298496K)] 256000K->22795K(981504K), 0.0142936 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
2020-04-26 14:37:19.597  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'userShiroConfig' of type [com.sxj.seed.shiro.UserShiroConfig$$EnhancerBySpringCGLIB$$9608c036] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.603  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.650  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties' of type [org.mybatis.spring.boot.autoconfigure.MybatisProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.655  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration' of type [org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$569f889d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.657  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure' of type [com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure$$EnhancerBySpringCGLIB$$3d772cdf] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.659  INFO 12360 --- [           main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
2020-04-26 14:37:19.707  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.711  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.druid.spring.boot.autoconfigure.stat.DruidFilterConfiguration' of type [com.alibaba.druid.spring.boot.autoconfigure.stat.DruidFilterConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.729  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'statFilter' of type [com.alibaba.druid.filter.stat.StatFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.784  INFO 12360 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
2020-04-26 14:37:19.784  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.797  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.976  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.980  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionTemplate' of type [org.mybatis.spring.SqlSessionTemplate] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.981  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminDao' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.982  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminDao' of type [com.sun.proxy.$Proxy68] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.982  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminService' of type [com.sxj.seed.service.impl.AdminServiceImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:19.982  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'userRealm' of type [com.sxj.seed.shiro.UserRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:20.087  INFO 12360 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:37:20.244  INFO 12360 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 80 (http)
2020-04-26 14:37:20.253  INFO 12360 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-04-26 14:37:20.253  INFO 12360 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.29]
2020-04-26 14:37:20.349  INFO 12360 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-04-26 14:37:20.349  INFO 12360 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1506 ms
2020-04-26 14:37:20.574  INFO 12360 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-04-26 14:37:20.627  INFO 12360 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2020-04-26 14:37:20.847  INFO 12360 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 80 (http) with context path ''
2020-04-26 14:37:20.849  INFO 12360 --- [           main] com.sxj.seed.SeedApplication             : Started SeedApplication in 2.367 seconds (JVM running for 4.012)


能看到啓動時間又快了一點點,而且GC的次數只有一次了

再調大一下年輕代:-Xmn900m

D:\work\util\jdk\JDK8_64\bin\java.exe -XX:+PrintGCDetails -XX:MetaspaceSize=64m -Xms1024m -Xmn950m -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:\work\util\IDEA\IntelliJ IDEA 2019.3.1\lib\idea_rt.jar=56924:D:\work\util\IDEA\IntelliJ IDEA 2019.3.1\bin" -Dfile.encoding=UTF-8 -classpath D:\work\util\jdk\JDK8_64\jre\lib\charsets.jar;D:\work\util\jdk\JDK8_64\jre\lib\deploy.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\access-bridge-64.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\cldrdata.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\dnsns.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\jaccess.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\jfxrt.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\localedata.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\nashorn.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\sunec.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\sunjce_provider.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\sunmscapi.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\sunpkcs11.jar;D:\work\util\jdk\JDK8_64\jre\lib\ext\zipfs.jar;D:\work\util\jdk\JDK8_64\jre\lib\javaws.jar;D:\work\util\jdk\JDK8_64\jre\lib\jce.jar;D:\work\util\jdk\JDK8_64\jre\lib\jfr.jar;D:\work\util\jdk\JDK8_64\jre\lib\jfxswt.jar;D:\work\util\jdk\JDK8_64\jre\lib\jsse.jar;D:\work\util\jdk\JDK8_64\jre\lib\management-agent.jar;D:\work\util\jdk\JDK8_64\jre\lib\plugin.jar;D:\work\util\jdk\JDK8_64\jre\lib\resources.jar;D:\work\util\jdk\JDK8_64\jre\lib\rt.jar;E:\seed\target\classes;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot\2.2.2.RELEASE\spring-boot-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-context\5.2.2.RELEASE\spring-context-5.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-autoconfigure\2.2.2.RELEASE\spring-boot-autoconfigure-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.1.1\mybatis-spring-boot-starter-2.1.1.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-starter\2.2.2.RELEASE\spring-boot-starter-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-starter-logging\2.2.2.RELEASE\spring-boot-starter-logging-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\work\util\IDEA\maven\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\work\util\IDEA\maven\repository\org\apache\logging\log4j\log4j-to-slf4j\2.12.1\log4j-to-slf4j-2.12.1.jar;D:\work\util\IDEA\maven\repository\org\apache\logging\log4j\log4j-api\2.12.1\log4j-api-2.12.1.jar;D:\work\util\IDEA\maven\repository\org\slf4j\jul-to-slf4j\1.7.29\jul-to-slf4j-1.7.29.jar;D:\work\util\IDEA\maven\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:\work\util\IDEA\maven\repository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-starter-jdbc\2.2.2.RELEASE\spring-boot-starter-jdbc-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\com\zaxxer\HikariCP\3.4.1\HikariCP-3.4.1.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-jdbc\5.2.2.RELEASE\spring-jdbc-5.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.1.1\mybatis-spring-boot-autoconfigure-2.1.1.jar;D:\work\util\IDEA\maven\repository\org\mybatis\mybatis-spring\2.0.3\mybatis-spring-2.0.3.jar;D:\work\util\IDEA\maven\repository\org\mybatis\mybatis\3.4.5\mybatis-3.4.5.jar;D:\work\util\IDEA\maven\repository\org\mybatis\generator\mybatis-generator-core\1.4.0\mybatis-generator-core-1.4.0.jar;D:\work\util\IDEA\maven\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\work\util\IDEA\maven\repository\com\alibaba\druid-spring-boot-starter\1.1.10\druid-spring-boot-starter-1.1.10.jar;D:\work\util\IDEA\maven\repository\org\slf4j\slf4j-api\1.7.29\slf4j-api-1.7.29.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-starter-data-jdbc\2.2.2.RELEASE\spring-boot-starter-data-jdbc-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\data\spring-data-jdbc\1.1.3.RELEASE\spring-data-jdbc-1.1.3.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\data\spring-data-relational\1.1.3.RELEASE\spring-data-relational-1.1.3.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\data\spring-data-commons\2.2.3.RELEASE\spring-data-commons-2.2.3.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-tx\5.2.2.RELEASE\spring-tx-5.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-beans\5.2.2.RELEASE\spring-beans-5.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-spring\1.4.0\shiro-spring-1.4.0.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-web\1.4.0\shiro-web-1.4.0.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-starter-thymeleaf\2.2.2.RELEASE\spring-boot-starter-thymeleaf-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\thymeleaf\thymeleaf-spring5\3.0.11.RELEASE\thymeleaf-spring5-3.0.11.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\thymeleaf\thymeleaf\3.0.11.RELEASE\thymeleaf-3.0.11.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\attoparser\attoparser\2.0.5.RELEASE\attoparser-2.0.5.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\unbescape\unbescape\1.1.6.RELEASE\unbescape-1.1.6.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\thymeleaf\extras\thymeleaf-extras-java8time\3.0.4.RELEASE\thymeleaf-extras-java8time-3.0.4.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-core\1.4.1\shiro-core-1.4.1.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-lang\1.4.1\shiro-lang-1.4.1.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-cache\1.4.1\shiro-cache-1.4.1.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-crypto-hash\1.4.1\shiro-crypto-hash-1.4.1.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-crypto-core\1.4.1\shiro-crypto-core-1.4.1.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-crypto-cipher\1.4.1\shiro-crypto-cipher-1.4.1.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-config-core\1.4.1\shiro-config-core-1.4.1.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-config-ogdl\1.4.1\shiro-config-ogdl-1.4.1.jar;D:\work\util\IDEA\maven\repository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar;D:\work\util\IDEA\maven\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\work\util\IDEA\maven\repository\org\apache\shiro\shiro-event\1.4.1\shiro-event-1.4.1.jar;D:\work\util\IDEA\maven\repository\com\github\theborakompanioni\thymeleaf-extras-shiro\2.0.0\thymeleaf-extras-shiro-2.0.0.jar;D:\work\util\IDEA\maven\repository\org\projectlombok\lombok\1.18.10\lombok-1.18.10.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-starter-web\2.2.2.RELEASE\spring-boot-starter-web-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-starter-json\2.2.2.RELEASE\spring-boot-starter-json-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\com\fasterxml\jackson\core\jackson-databind\2.10.1\jackson-databind-2.10.1.jar;D:\work\util\IDEA\maven\repository\com\fasterxml\jackson\core\jackson-annotations\2.10.1\jackson-annotations-2.10.1.jar;D:\work\util\IDEA\maven\repository\com\fasterxml\jackson\core\jackson-core\2.10.1\jackson-core-2.10.1.jar;D:\work\util\IDEA\maven\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.10.1\jackson-datatype-jdk8-2.10.1.jar;D:\work\util\IDEA\maven\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.10.1\jackson-datatype-jsr310-2.10.1.jar;D:\work\util\IDEA\maven\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.10.1\jackson-module-parameter-names-2.10.1.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-starter-tomcat\2.2.2.RELEASE\spring-boot-starter-tomcat-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.29\tomcat-embed-core-9.0.29.jar;D:\work\util\IDEA\maven\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.29\tomcat-embed-el-9.0.29.jar;D:\work\util\IDEA\maven\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.29\tomcat-embed-websocket-9.0.29.jar;D:\work\util\IDEA\maven\repository\org\springframework\boot\spring-boot-starter-validation\2.2.2.RELEASE\spring-boot-starter-validation-2.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\jakarta\validation\jakarta.validation-api\2.0.1\jakarta.validation-api-2.0.1.jar;D:\work\util\IDEA\maven\repository\org\hibernate\validator\hibernate-validator\6.0.18.Final\hibernate-validator-6.0.18.Final.jar;D:\work\util\IDEA\maven\repository\org\jboss\logging\jboss-logging\3.4.1.Final\jboss-logging-3.4.1.Final.jar;D:\work\util\IDEA\maven\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-web\5.2.2.RELEASE\spring-web-5.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-webmvc\5.2.2.RELEASE\spring-webmvc-5.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-aop\5.2.2.RELEASE\spring-aop-5.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-expression\5.2.2.RELEASE\spring-expression-5.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\com\github\pagehelper\pagehelper\5.1.2\pagehelper-5.1.2.jar;D:\work\util\IDEA\maven\repository\com\github\jsqlparser\jsqlparser\1.0\jsqlparser-1.0.jar;D:\work\util\IDEA\maven\repository\com\github\pagehelper\pagehelper-spring-boot-starter\1.2.5\pagehelper-spring-boot-starter-1.2.5.jar;D:\work\util\IDEA\maven\repository\com\github\pagehelper\pagehelper-spring-boot-autoconfigure\1.2.5\pagehelper-spring-boot-autoconfigure-1.2.5.jar;D:\work\util\IDEA\maven\repository\com\alibaba\druid\1.1.20\druid-1.1.20.jar;D:\work\util\IDEA\maven\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\work\util\IDEA\maven\repository\mysql\mysql-connector-java\8.0.18\mysql-connector-java-8.0.18.jar;D:\work\util\IDEA\maven\repository\com\alibaba\fastjson\1.2.62\fastjson-1.2.62.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-core\5.2.2.RELEASE\spring-core-5.2.2.RELEASE.jar;D:\work\util\IDEA\maven\repository\org\springframework\spring-jcl\5.2.2.RELEASE\spring-jcl-5.2.2.RELEASE.jar com.sxj.seed.SeedApplication

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.2.RELEASE)

2020-04-26 14:42:29.745  INFO 13948 --- [           main] com.sxj.seed.SeedApplication             : Starting SeedApplication on DESKTOP-C0UPCFC with PID 13948 (E:\seed\target\classes started by zx in E:\seed)
2020-04-26 14:42:29.747  INFO 13948 --- [           main] com.sxj.seed.SeedApplication             : No active profile set, falling back to default profiles: default
2020-04-26 14:42:30.294  INFO 13948 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JDBC repositories in DEFAULT mode.
2020-04-26 14:42:30.316  INFO 13948 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 17ms. Found 0 JDBC repository interfaces.
2020-04-26 14:42:30.526  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'userShiroConfig' of type [com.sxj.seed.shiro.UserShiroConfig$$EnhancerBySpringCGLIB$$c45628a8] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.532  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.580  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties' of type [org.mybatis.spring.boot.autoconfigure.MybatisProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.585  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration' of type [org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration$$EnhancerBySpringCGLIB$$84ecf10f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.588  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure' of type [com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure$$EnhancerBySpringCGLIB$$6bc49551] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.590  INFO 13948 --- [           main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
2020-04-26 14:42:30.632  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.637  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.druid.spring.boot.autoconfigure.stat.DruidFilterConfiguration' of type [com.alibaba.druid.spring.boot.autoconfigure.stat.DruidFilterConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.657  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'statFilter' of type [com.alibaba.druid.filter.stat.StatFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.702  INFO 13948 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
2020-04-26 14:42:30.702  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.712  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.903  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.909  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionTemplate' of type [org.mybatis.spring.SqlSessionTemplate] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.910  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminDao' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.912  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminDao' of type [com.sun.proxy.$Proxy68] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.912  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'adminService' of type [com.sxj.seed.service.impl.AdminServiceImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:30.913  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'userRealm' of type [com.sxj.seed.shiro.UserRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:31.026  INFO 13948 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-04-26 14:42:31.212  INFO 13948 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 80 (http)
2020-04-26 14:42:31.221  INFO 13948 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-04-26 14:42:31.222  INFO 13948 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.29]
2020-04-26 14:42:31.325  INFO 13948 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-04-26 14:42:31.326  INFO 13948 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1533 ms
2020-04-26 14:42:31.532  INFO 13948 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-04-26 14:42:31.590  INFO 13948 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2020-04-26 14:42:31.810  INFO 13948 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 80 (http) with context path ''
2020-04-26 14:42:31.812  INFO 13948 --- [           main] com.sxj.seed.SeedApplication             : Started SeedApplication in 2.351 seconds (JVM running for 3.949)
[GC (Allocation Failure) [PSYoungGen: 730112K->39345K(851456K)] 730112K->39465K(927232K), 0.0239268 secs] [Times: user=0.13 sys=0.02, real=0.02 secs] 

能看到GC是在啓動後在才GC,但是這樣已經可以了,在設置就沒必要了,已經足夠了

運行優化:

在運行時進行優化就需要藉助jemter壓測工具了
添加參數,查看單線程SerialGC工具的使用情況:-XX:+UseSerialGC
在這裏插入圖片描述
查看多線程的GC情況:-XX:+UseParNewGC
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章