{'fraction_non_alphanumeric': 0.023972602739726026, 'fraction_numerical': 0.00684931506849315, 'mean_word_length': 5.305755395683454, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Compiler-Assisted Memory Management Using Escape Analysis in the KESO JVM

Escape analysis can be used for automatic memory management in Java. Based on the work of Choi et al. in 2003 [CGS03], this thesis improves the existing escape analysis in KESO, a Java virtual machine for deeply embedded systems. Enhancements implemented for this document include flow-sensitive analysis, modifications that reduce compile time and a fix for a conceptual flaw in the work of Choi et al. Further analysis explored the possibility of allocating objects in callers’ stack frames or memory regions. Based on the computed analysis results, two different optimization backends are presented and compared: The preexisting stack allocation and a new method using task-local heaps automatically managed in a stack-like fashion with precise overflow checks. Both methods have predictable allocation and deallocation behavior and can guarantee tight upper bounds of their runtime since they do not suffer from external fragmentation. This increases predictability, which is beneficial in an embedded real-time Java environment. Besides memory management, the thesis discusses other usage possibilities of escape analysis results, such as optimizations in remote procedure calls, synchronization optimizations, and a new theoretical approach to cycle-aware reference counting. Compiler-assisted memory management pays positively: In a real-time Java benchmark, object lifetime is automatically inferred at up to 43.7 % of all allocation sites. The optimizations reduce heap memory usage, in some cases to less than half of what it was without automatic memory management using escape analysis. Additionally, the benchmark’s time requirements are cut short by up to 18.7 %.