MarkAndCompact: Implementing a Scavenger in Smalltalk



Following with the implementation of a Generational Scavenger which we presented here at ESUG last year, we decided to implement a MarkAndCompact Scavenger to complete a Smalltalk memory reclamation engine.

In this talk we will show the fundamentals of the MarkAndCompact Scavenger, as described by Morris in 1978 [1]. With this algorithm in mind, we will show our completed implementation, written in Smalltalk and compiled with our JIT. As a continuation to our work we'll describe some speed-up optimizations we implemented, Polymorphic Inline Cache, Monomorphic Inline Cache with linked sends, rewritten primitives and inlined methods. We'll also discuss the next steps in this journey, where we plan to integrate this scavenger with the JIT, as the direction to achieve a complete JIT Smalltalk VM written in itself.

[1] Ballard, S. and Shirron, S. 1983 The design and implementation of VAX/Smalltalk-80. In Smalltalk-80: Bits of History, Words of Advice, Addison Wesley, September.


In the last 11 years Javier Burroni has worked as part of a team developing information security products, specializing in low level and cross operating system topics, as well as VM implementation and interoperability problems. He has spoken about security and networking at international conferences, and published papers on this subjects. In the last years he has been dedicated to understand and implement a JIT Smalltalk VM written in itself.