zoukankan      html  css  js  c++  java
  • 升级sts4 ,碰到的坑,maven打jar包,ehcache的内存泄露

    之前,在eclipse 2019中,新建springboot项目 pom出错,需要改

    <!-- <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> -->

    现在这句可以废弃不用了,默认的sts4带的,就可以。

    在maven打jar包,仍会碰到无法把jsp页面,包进去的情况,,1.4.2的版本,仍需表明。

    <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>1.4.2.RELEASE</version>
                    
                    <configuration>
                    <mainClass>cn.taotao.Zhouyi3Application</mainClass>
                        <excludes>
                            <exclude>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                            </exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <configuration>
                        <encoding>UTF-8</encoding>
                        <useDefaultDelimiters>true</useDefaultDelimiters>
                    </configuration>
                </plugin>
            </plugins>

    在ehcache中,出现大量的驻留内存。

    使用这个方法,测试去掉ehcache的内存泄露

    @Configuration
    public class EhcacheListenerConfig {
    
        @Bean
        public IntrospectorCleanupListener introspectorCleanupListener() {
            return new IntrospectorCleanupListener();
        }
        
        @Bean
        public ServletListenerRegistrationBean<IntrospectorCleanupListener> servletListenerRegistrationBean(IntrospectorCleanupListener myListener){
             ServletListenerRegistrationBean<IntrospectorCleanupListener> registrationBean = new ServletListenerRegistrationBean<IntrospectorCleanupListener>();
             
             registrationBean.setListener(myListener);
             return registrationBean;
            
        }
    }
  • 相关阅读:
    机器学习入坑指南(二):数据预处理
    03双向链表
    小甲鱼 例题
    快慢指针问题
    02循环单链表
    01静态链表
    阈值化
    图像金字塔与图片尺寸缩放
    水漫填充
    形态学滤波(4):使用分水岭算法对图像进行分割
  • 原文地址:https://www.cnblogs.com/sdgtxuyong/p/14537424.html
Copyright © 2011-2022 走看看