Giter Site home page Giter Site logo

-XX:+FreeHeapPhysicalMemory 既然也支持了,能否把-XX:PeriodicGCInterval -XX:ForcePeriodicGCInterval 也考虑支持一下呢 about tencentkona-11 HOT 3 OPEN

tencent avatar tencent commented on May 14, 2024
-XX:+FreeHeapPhysicalMemory 既然也支持了,能否把-XX:PeriodicGCInterval -XX:ForcePeriodicGCInterval 也考虑支持一下呢

from tencentkona-11.

Comments (3)

jiangguilong2000 avatar jiangguilong2000 commented on May 14, 2024

有几点建议:
为什么会用到这个特性,是因为O JDK 持有内存不释放的问题,进程占用过多,以前ALi JDK里也有这个特性,个人觉得触发的最佳时机

  1. 急需要释放出更多的系统内存,比如系统内存占用达到了 80%
    2.在每天负载最低时,比如凌晨,也就是可以定时指定触发 ,写cron表达式

以前是自己写了个脚本,用来检测系统内存,如果达到80%,会把JAVA进程强制主动触发一次FULLGC,每天早上6点也会定时强制触发一次,不知能否把这种触发时机 用启动参数实现一下呢?

from tencentkona-11.

tbzhang avatar tbzhang commented on May 14, 2024

感谢您的建议!
之前主要考虑到-XX:PeriodicGCInterval -XX:ForcePeriodicGCInterval 确实可以被一些强制触发Full GC的脚本替代,因此没有急着把KonaJDK8的这些功能迁移到JDK11上面来,并且KonaJDK11也移植了"JEP 346: Promptly Return Unused Committed Memory from G1", 使用更小代价的concurrent gc来回收内存,后面我们会考虑将这两个参数以及对于其他GC的支持都移植到KonaJDK11上面来

至于系统内存(RSS)达到了80%触发Full GC的话,在JVM进程内部可能需要额外的定时检测手段才行,这个我们也会考虑下在JVM内部实现是否合适,如果合适的话,后续也会考虑支持下这个机制

如果只是堆内存占用到了80%触发内存回收的话,像是G1的话,比如您可以设置InitiatingHeapOccupancyPercent为一个合适的值,并且设置-Xms是一个小于-Xmx的值,根据"JEP 346"那么整堆超过一定的IHOP比例就会触发内存回收,当然JEP346的使用concurrent gc来归还内存的效率并没有Full GC的那么高

from tencentkona-11.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.