redhat-developer / redhat-developer/vscode-java
Enable JVM Heap trimming by default
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 546
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
@maxandersen and @franz1981 taught me java 17 has support for jvm reclaiming memory back to the os:
- https://bugs.openjdk.org/browse/JDK-8293114 this is the feature
- this is what we have for G1 instead: https://bugs.openjdk.org/browse/JDK-8204089
And Netty behaviour is what's missing from the puzzle (see https://github.com/netty/netty/discussions/11845#discussion-3690282)
Meaning that while idle, https://bugs.openjdk.org/browse/JDK-8204089 just shrink back the heap RSS to xms
we need 2 set of VM args to be passed:
- autotrim interval -> which requires something like -XX:+UnlockExperimentalVMOptions -XX:TrimNativeHeapInterval=5000
- G1 periodic GC: -> G1PeriodicGCInterval, G1PeriodicGCInvokesConcurrent and G1PeriodicGCSystemLoadThreshold (for https://bugs.openjdk.org/browse/JDK-8204089)
OpenJDK supports -XX:+IgnoreUnrecognizedVMOptions, in case users run an older JDK 17 that doesn't support the new flags, and OpenJ9 simply ignores unknown flags, so it's probably safe to try it out on insider builds.
@rgrunber @testforstephen @jdneo WDYT?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
检查扩展如何将 JVM 参数传递给 Java language server,然后将请求的 flags 与 OpenJDK JDK-8293114 和 JDK-8204089 以及所引用的 Netty 讨论进行比较。完成标准是默认启用 heap-trimming 和 G1 周期性 GC 选项,同时保留在较旧 JDK 17 版本和 OpenJ9 上的行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- developer-experience, performance
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100