linux jetty9 内存配置,Jetty 9 + Java > 8u74 always allocates maximum (-Xmx) memory on Linux?

问题

If I start a Java application using jre 8u74 on Linux using -Xmx512m the memory is not allocated immediately, the memory is allocated if Java needs it. So it can stay below the 512 MB limit if not necessary. This is what I would expect.

On Java 8u111 I get another behavior, the 512 MB of memory is always allocated immediately to the process even if Java does not need it. This is annoying since this memory cannot be used by other processes, even if Java does not need it.

I looked trhough the release notes for the Java jre's starting with 8u74 till the currently newst 8u111 but I cannot find any reference to a change in the memory allocation strategy.

Can someone confirm this allocation strategy change within the Java 8 range?

Is there an option to have the previous memory allocation behavior?

Edit 1 - -XX:+PrintFlagsFinal diff (as suggested by the8472)

diff java-info-8u111.txt java-info-8u74.txt

161d160

< bool CrashOnOutOfMemoryError = false {product}

199d197

< bool ExitOnOutOfMemoryError = false {product}

636d633

< bool UseCountedLoopSafepoints = false {C2 product}

666,668d662

< bool UseMontgomeryMultiplyIntrinsic = false {C2 product}

< bool UseMontgomerySquareIntrinsic = false {C2 product}

< bool UseMulAddIntrinsic = false {C2 product}

698d691

< bool UseSquareToLenIntrinsic = false {C2 product}

729,731c722,724

< java version "1.8.0_111"

< Java(TM) SE Runtime Environment (build 1.8.0_111-b14)

< Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

---

> java version "1.8.0_74"

> Java(TM) SE Runtime Environment (build 1.8.0_74-b02)

> Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)

Edit 2 - Related Issues

https://github.com/eclipse/jetty.project/issues/575

Java 8 with Jetty on linux memory issue

Jetty startup delay due to scanning

Edit 3 - Solution

The problem is related to the combination Java8/9 and Jetty9. A workaround is to comment out the contents of the Jetty annotations.mod. See my complete answer to this related question.

Thanks for all suggestions and new debugging ideas.

来源:https://stackoverflow.com/questions/40807646/jetty-9-java-8u74-always-allocates-maximum-xmx-memory-on-linux

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值