Article Dans Une Revue ACM Transactions on Programming Languages and Systems (TOPLAS) Année : 2025

Will it Fit? Verifying Heap Space Bounds of Concurrent Programs under Garbage Collection

Résumé

We present IrisFit, a Separation Logic with space credits for reasoning about heap space in a concurrent call-by-value language equipped with tracing garbage collection and shared mutable state. We point out a fundamental difficulty in the analysis of the worst-case heap space complexity of concurrent programs in the presence of tracing garbage collection: if garbage collection phases and program steps can be arbitrarily interleaved, then there exist undesirable scenarios where a root held by a sleeping thread prevents a possibly large amount of memory from being freed. To remedy this problem and eliminate such undesirable scenarios, we propose several language features, namely possibly-blocking memory allocation, polling points, and protected sections. Polling points are meant to be automatically inserted by the compiler; protected sections are delimited by the programmer and represent regions where no polling points must be inserted. The heart of our contribution is IrisFit, a novel program logic that can establish worst-case heap space complexity bounds and whose reasoning rules can take advantage of the presence of protected sections. IrisFit is formalized inside the Coq proof assistant, on top of the Iris Separation Logic framework. We prove that IrisFit offers both a safety guarantee—programs cannot crash and cannot exceed a heap space limit—and a liveness guarantee—provided enough polling points have been inserted, every memory allocation request is satisfied in bounded time. We illustrate the use of IrisFit via several case studies, including a version of Treiber's stack whose worst-case behavior relies on the presence of protected sections.
Fichier principal
Vignette du fichier
irisfit.pdf (953) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)
Licence

Dates et versions

hal-04946590 , version 1 (13-02-2025)

Licence

Identifiants

Citer

Alexandre Moine, Arthur Charguéraud, François Pottier. Will it Fit? Verifying Heap Space Bounds of Concurrent Programs under Garbage Collection. ACM Transactions on Programming Languages and Systems (TOPLAS), 2025, ⟨10.1145/3716312⟩. ⟨hal-04946590⟩
0 Consultations
0 Téléchargements

Altmetric

Partager

More