Parallel GC and Heap Management in Poly/ML and Isabelle David C.J. Matthews David.Matthews@prolingua.co.uk
Summary Minor GC Major GC Sharing pass Heap sizing
Poly/ML and Isabelle Poly/ML Isabelle David Matthews Larry Paulson Tobias Nipkow Makarius Wenzel
Standard ML Mutable data Immutable data Mostly immutable Ref Array Mutex / Condition variable Immutable data List Closure Mostly immutable Most cells have short lifetime Equality of immutables is by value
Minor Collector Values initially allocated in allocation area Copying collector Mutable cells to mutable area Immutable cells to immutable area Only mutable area is scanned for roots
Parallelising Minor Collector Multiple threads process roots Work sharing Lock-free update of forwarding pointers No locking on immutable data Weak coherence
Major GC Mark-sweep Compacting
Parallelising Major GC Lock-free marking Marking is idempotent Sweep phase can operate on separate segments
Sharing phase Combine cells with same contents Recursively apply for lists and trees Quicksort Parallel Expensive - O(n log n) Reduces the live heap size
Heap sizing Paging Live data GC Cost Heap size
Heap sizing: Small Live Data GC Cost Target Heap size
Heap sizing: Large live data GC Cost Target Heap size
Heap sizing Estimate a cost function Calculate a minimum Trigger sharing pass
Parallel Isabelle
JinjaThreads: 64 bit
JinjaThreads: 32 bit