1# 1. INTRODUCTION 2 3The main components of Panda memory management: 4* Allocators 5* GC 6 7Allocators has two purposes: 81. Allocations for the application 91. Allocations for the internal usage by Runtime(Allocations for compiler purposes, for GC internal structures etc) 10 11Garbage Collector: 12Garbage collector(GC) automatically recycles memory that it can prove will never be used again. 13GC used to recycle memory allocated as result of application work(objects, compiled code etc). 14 15# 2. OVERALL DESCRIPTION 16 17## Allocator 18 19### Alocator Types 20- Bump pointer allocator 21- Arena Allocator (objects can be deallocated at once(list of arenas, almost at once - O(number of arenas in the list))) 22- Freelist allocator 23- TLAB 24- Run of slots allocator 25- Code allocator 26 27### Spaces 28 29- Code space (executable) 30- Compiler Internal Space(linked list of arenas) 31- Internal memory space for non-compiler part of runtime (including GC internals) 32- Object space 33- Non-moving space(space for non-movable objects) 34 35## GC 36 37- Concurrent generational GC (optional - we can disable generational mode) 38- GC for classes (optional) 39- GC for code cache(optional) 40 41Reference processor. 42 43High level requirements for GC: 44- acceptable latency (max pause) for good user experience 45- acceptable throughput 46- acceptable footprint size 47 48# 3. KEY FEATURES OF MEMORY MANAGEMENT SYSTEM 49 50Configurable flexible setup "Set of allocators + GC" 51We can use profile to choose MM configuration for application (for example: we can choose non-compacting GC with freelist allocators for some application if we get acceptable metrics for this) 52 53 54# 4. INTERACTION WITH OTHER COMPONENTS 55 56## Allocator 57 58- allocator API for runtime 59- TLAB API for compiler and interpreter 60- interfaces for tools? 61 62## GC 63 64- Safepoints 65- Reference storage and additional interfaces for MM <-> JNI interaction 66- Barriers API for compiler and interpreter 67- Possibility to change VRegs for any frame in the stack 68- interfaces for tools? 69 70# 5. ADDITIONAL REQUIREMENTS 71 72- Memory management flexible enough to work with multiple languages. 73- provide various statistics data 74 75