一句话:提出 Iso——首个面向 Java 的请求私有垃圾回收器,用 mark-region 堆与机会式复制显著降低请求型服务的 GC 开销。
大型、营收关键的 Java 服务对延迟、吞吐与内存极为敏感,而 Java 类型系统不暴露不可变性,使对象移动与线程局部回收难以兼得。作者观察到一类重要的服务器应用是按请求组织的:对象生命周期与请求生命周期强绑定,多数对象仅在其被分配的请求内可见,而全局操作是可扩展响应性的主要瓶颈。若能在请求私有范围内回收,即可兼顾响应性与效率,但难点在于请求私有回收无法安全移动可能被请求外引用的对象,而移动对象又是现代高性能收集器的基本要求。Iso 基于 mark-region 堆结构,采用机会式复制解决无不可变性语言中实用的线程局部回收问题,并动态跟踪对象可见性。论文首次详细分析 Java 工作负载在 thread-local 回收下的行为,指出既有基准的不足并提出新基准。评估显示可见性跟踪开销仅 2%(Tomcat、Spring 等),在适度堆下执行时间比 OpenJDK 默认的 G1 分别快 32% 与 22%。
Large-scale, revenue-critical application services are often written in Java or other memory-safe languages whose type systems do not expose immutable state. Such applications are especially exposed to garbage collection performance overheads because latency, throughput, and memory consumption are first-order concerns for service providers. We observe that: i) An important class of server applications are request-based: they scale by concurrently servicing large numbers of quasi-independent requests. ii) Object lifetimes are strongly tied to request lifetimes. iii) Most objects remain private to the request in which they were allocated. iv) Global operations are the primary impediment to responsiveness at scale. If we could perform request-private garbage collection , we might achieve both responsiveness and efficiency at scale. Unfortunately, this straightforward insight runs into significant practical problems. The most obvious of these is that a request-private collection cannot safely move objects that may be referenced outside the scope of that request, and yet moving objects is a requirement of most modern high performance collector designs. This dilemma can be sidestepped by exploiting immutability, which is unfortunately not practical in languages like Java whose type systems do not expose it. We develop Iso, a garbage collector for request-based services that exploits a mark-region heap structure to solve these impediments and deliver outstanding performance. The key contributions of this paper are that: i) We use opportunistic copying to solve the problem of practical thread-local garbage collection for languages without exploitable immutability. ii) We provide the first detailed analysis of the behavior of Java workloads with respect to thread-local collection, identify shortcomings of existing benchmarks and introduce a new one. iii) We design, implement, and evaluate Iso, a practical and effective request-private GC. We show that dynamic tracking of object visibility, a prerequisite for request-private GC, incurs an overhead of just 2% for important request-based workloads including Tomcat and Spring. Iso demonstrates that for suitable workloads, request-based garbage collection is extremely effective, outperforming OpenJDK with its default collector, G1, by 32% and 22% in execution time in a modest heap. This work presents the first request-private garbage collector for Java. It shows a promising way forward for highly responsive collection on an important class of large scale workloads.