Memory Fully utilized by Java ConcurrentHashMap (under Tomcat)

前端 未结 5 2021
执笔经年
执笔经年 2020-12-02 19:17

This is a memory stack (serves as a cache) that consist of nothing but a static ConcurrentHashMap (CHM).

All incoming HTTP request data are store in this Concurrent

5条回答
  •  旧巷少年郎
    2020-12-02 19:56

    If you get this exception and are using spring boot version 1.4.4 RELEASE or lower, set value of property "server.session-timeout" in minutes, rather than what they suggest (seconds), so that the sessions on the heap will be cleaned in time. Or you can use a bean of EmbeddedServletContainerCustomizer but the provided value will be set in minutes.

    example (session timeout in 10 minutes): server.session-timeout=10 (set in properties file) container.setSessionTimeout(10, TimeUnit.SECONDS); (set in EmbeddedServletContainerCustomizer)

提交回复
热议问题