Safe Memory Regions for Big Data Processing
- Gowtham Kaki ,
- G. Ramalingam ,
- Kapil Vaswani ,
- Dimitrios Vytiniotis
|
Recent work in high-performance systems written in managed languages (such as Java or C#) has shown that garbagecollection can be a significant performance bottleneck. A class of these systems, focused on big-data, create many and often large data structures with well-defined lifetimes. In this paper, we present a language and a memory management scheme based on user-managed memory regions (called transferable regions) that allow programmers to exploit knowledge of data structures’ lifetimes to achieve significant performance improvements. Manual memory management is susceptible to the usual perils of dangling pointers. A key contribution of this paper is a refinement-based region type system that ensures the memory safety of C# programs in the presence of transferable regions. We complement our type system with a type inference algorithm that infers principal region types for first-order programs, and practically useful types for higherorder programs. This eliminates the need for programmers to write region annotations on types, while facilitating the reuse of existing C# libraries with no modifications. Experiments demonstrate the practical utility of our approach.