且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JVM垃圾收集和分页内存体系结构

更新时间:2023-09-26 19:21:22

你是对的,垃圾收集器和虚拟内存管理器必须协作,否则GC将垃圾系统。 Matthew Hertz,Yi Feng和Emery D. Berger对此类GC /内核协作进行了调查。为了获得良好的性能,他们不得不稍微扩展内核,并调整垃圾收集器。



在高内存压力下,他们的基准测试使用了更长的160倍GenMS Java GC。使用新的页面感知GC,基准测试速度只降低了1.6倍。换句话说,通过适当调整的GC,性能提高了100倍。

http://lambda-the-ultimate.org/node/2391


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 or less breaks when running in a paged memory architecture, and parts of the heap is getting paged out.

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.

I know the best practice is to keep the max heap less than the physical memory. (Or you will see your application swap to death) but the idea - at least in the unix world, is that the memory could be better spent for filesystem caches etc.

My question is: Are there any paging (aware) garbage collecting algorithms?

You are correct, the garbage collector and the virtual memory manager have to collaborate otherwise the GC will trash the system. Such a GC/kernel collaboration has been investigated by Matthew Hertz, Yi Feng and Emery D. Berger. In order to obtain good performance, they had to extend the kernel slightly and also tweak the garbage collector.

Under high memory pressure, their benchmark took something like 160x longer using the GenMS Java GC. With the new, page-aware GC, the benchmark was only 1.6 times slower. In other words, with a properly tuned GC, there is a 100x performance gain.

http://lambda-the-ultimate.org/node/2391