JVM garbage collection and a paging memory architecture

前端 未结 5 1149
傲寒
傲寒 2021-01-31 20:14

In the recent 10 year when discussing java and/or garbage collection, the only performance penalty that I have not been able to defend is that garbage collection algorithms more

5条回答
  •  醉酒成梦
    2021-01-31 20:34

    Unix systems (and especially Linux) agressively pages out memory that has not been touched for a while, and while that is good for your average leaking c application, it kill javas perfomance in memory tight situations.

    Keep in mind that this is typically a tunable setting -- vm.swappiness for the Linux kernel, for example. You can read a blog article I wrote on this if you want some more in depth information about swap-tuning on Linux.

    Are there any paging (aware) garbage collecting algorithms?

    Garbage collection algorithms are typically designed for a very wide variety of possible programs as input and for operation in a large array of possible environments; their design needs to take this into account. I think it would be really challenging to make a "paging-aware" gc algorithm that was broadly useful. If you were writing one for a very specialized environment where you could lock down things, then I think you'd have a pretty good chance of producing a good result.

提交回复
热议问题