There are many tools that help programmers find code fragments, but most are inexpressive and rely on static information. We present a new technique for synthesizing code that is dynamic (giving accurate results and allowing programmers to reason about concrete executions), easy-to-use (supporting a wide range of correctness specifications), and interactive (allowing users to refine the candidate code snippets). Our implementation, which we call CodeHint, generates and evaluates code at runtime and hence can synthesize real-world Java code that involves I/O, reflection, native calls, and other advanced language features. We have evaluated CodeHint in two user studies and show that its algorithms are efficient and that it improves programmer productivity by more than a factor of two.
Garbage collection is widely used and has largely been a boon for programmer productivity. However, traditional garbage collection is approaching both practical and theoretical performance limits. In practice, the maximum heap size and heap structure of large applications are influenced as much by garbage collector behavior as by resource availability. We present an alternate approach to garbage collection wherein the programmer provides untrusted deallocation hints. Usage of deallocation hints is similar to trusted manual deallocation, but the consequence of an inaccurate hint is lost performance not correctness. Our hinted collector algorithm uses these hints to identify a subset of unreachable objects with both better parallel asymptotic complexity and practical performance. On some benchmarks, our prototype collector implementation achieves 10-20% pause time reductions. We close with a discussion of the design trade-offs inherent in our approach and lessons to be learned from our collector.
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission. Acknowledgement I would like to thank Martin Maas, Joel Galenson, and Krste Asanovic for early constructive criticism of the ideas that appeared in this thesis. Many members of the Parallel Computing Laboratory (ParLab) have been subjected to half-baked versions of these ideas; thank you for your patience and questions. I would like to thank my advisor George Necula for his support. Abstract Hinted Collection Garbage collection is widely used and has largely been a boon for programmer productivity. However, traditional garbage collection is approaching both practical and theoretical performance limits. In practice, the maximum heap size and heap structure of large applications are influenced as much by garbage collector behavior as by resource availability. We present an alternate approach to garbage collection wherein the programmer provides untrusted deallocation hints. Usage of deallocation hints is similar to trusted manual deallocation, but the consequence of an inaccurate hint is lost performance not correctness. Our hinted collection algorithm uses these hints to identify a subset of unreachable objects with both better parallel asymptotic complexity and practical performance. We present two prototype implementations of a stop-the-world hinted collector: one entirely serial and one parallel. We evaluate our implementations by comparing against the Boehm-Demers-Weiser [12] conservative garbage collector for C/C++. We leverage existing free calls in mature C programs to stand in for deallocation hints. On some benchmarks, our serial collector implementation achieves 10-20% pause time reductions over a well-tuned baseline. On four cores, our parallel implementation achieves similar benefits. We include a discussion of the design trade-offs inherent in our approach, and lessons to be learned from our collectors. We close with a discussion of several design variants which we have not been able to explore in depth, but believe would be worthwhile to explore in future work.
Most programs contain conceptually simple statements that are difficult to write. We propose a new methodology that allows programmers to give partial dynamic specifications of the results of statements in a particular program state, and which uses them to synthesize candidate statements. Building on previous work, these specifications can consist of information about the type or value of a desired expression or can be arbitrary predicates relating the input and output states. We implemented our methodology in a tool named CodeHint and ran a user study where we found that programmers used it when given the choice.
GPUs have become part of most commodity systems. Nonetheless, they are often underutilized when not executing graphics-intensive or special-purpose numerical computations, which are rare in consumer workloads. Emerging architectures, such as integrated CPU/GPU combinations, may create an opportunity to utilize these otherwise unused cycles for offloading traditional systems tasks. Garbage collection appears to be a particularly promising candidate for offloading, due to the popularity of managed languages on consumer devices. We investigate the challenges for offloading garbage collection to a GPU, by examining the performance trade-offs for the mark phase of a mark & sweep garbage collector. We present a theoretical analysis and an algorithm that demonstrates the feasibility of this approach. We also discuss a number of algorithmic design trade-offs required to leverage the strengths and capabilities of the GPU hardware. Our algorithm has been integrated into the Jikes RVM and we present promising performance results.
Mobile applications are a nascent market waiting to be tapped. Next generation mobiles offer a promise of specialized hardware such as multi-touch screens (like the Apple iPhone) or motion sensors (as with the Nintendo Wii) which will enable exciting new applications. In order to make optimal use of these hardware devices, applications must directly interact with the hardware. However, the ability to use native applications carries a certain risk for both device security and reliability. For example, a rogue application could compromise your address book or flood a mobile network. We propose to solve this problem by limiting the access of native applications through confinement in virtual machines that allow applications to access fully- featured hardware efficiently, while isolating dangerous functionality from other virtual machines. Following a brief discussion of relevant background material, we discuss and explore the use cases and issues that make embedded virtualization challenging. Then, we describe the initial exploration efforts and the goals that were established for the prototype. We then present the resulting architecture in detail. Finally, we conclude with a brief listing of future work planned and a summary of related work.
Existing operating system (OS) designs provide inadequate isolation of user applications from errors that occur in OS services. If an error causes the failure of an OS service, all dependent applications are affected. The OS design described in this paper ameliorates this problem by reorganizing OS state in an effort to make OS services transparently restartable. This is achieved by partitioning application-related OS state into isolated per-application memory regions. Access to these memory regions is provided to OS services on a "need-to-know" basis when processing application requests. Applications are not allowed access to these memory regions for security. This design helps improve the dependability of the system.