Probabilistic resource limits using StatMemprof
Abstract
We present Memprof-limits, a probabilistic implementation of per-thread global memory limits, and per-thread allocation limits, for OCaml 4.12.
• Per-thread global memory limits let you limit the size the major heap can reach in specific parts of your program.
• Per-thread allocation limits let you bound the execution of parts of the program measured in number of allocation, analogous to the same feature in Haskell. Allocation limits count allocations but not deallocations, and is therefore a measure of the work done which can be more suitable than execution time in addition to being more portable.
The two main conceptual contributions are the following:
1. we provide Memprof-limits with a statistical analysis that the user can rely on to get guarantees about the enforcement of limits.
2. we provide Memprof-limits with a guide on how to recover from asynchronous exceptions and other unexpected exceptions, thereby summarising practical knowledge acquired in OCaml by the Coq proof assistant, and also acquired in other programming languages such as Isabelle/ML—to my knowledge written for the first time.
Domains
Programming Languages [cs.PL]Origin | Files produced by the author(s) |
---|