1 / 19

Increasing Memory Usage in Real-Time GC

Increasing Memory Usage in Real-Time GC. Tobias Ritzau and Peter Fritzson Department of Computer and Information Science Linköpings universitet tobri@ida.liu.se http://www.ida.liu.se/~tobri. The Problem. Published “real” real-time garbage collectors consume too much memory

Download Presentation

Increasing Memory Usage in Real-Time GC

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Increasing Memory Usage inReal-Time GC Tobias Ritzau and Peter Fritzson Department of Computer and Information Science Linköpings universitet tobri@ida.liu.se http://www.ida.liu.se/~tobri

  2. The Problem • Published “real” real-time garbage collectors consume too much memory • A large portion of the overhead is caused by type information, internal fragmentation, and GC house keeping • However, most GC techniques also require a buffer to hold dead objects Increasing Memory Usage in Real-Time GC

  3. Mark-Sweep Root Increasing Memory Usage in Real-Time GC

  4. RT-Copying Increasing Memory Usage in Real-Time GC

  5. RT-Mark-Sweep (JamaicaVM) Increasing Memory Usage in Real-Time GC

  6. Available Memory • The amount of available memory using real-time garbage collection and a heap of 12 – 36 byte objects (equally distributed) is • Copying GC: 25% • Mark-Sweep (JamaicaVM): 31% • Reference Counting: 47% Increasing Memory Usage in Real-Time GC

  7. Reference Counting 1 2 1 1 0 1 0 1 0 1 2 1 2 0 1 Root Increasing Memory Usage in Real-Time GC

  8. Reference Counting • Disadvantages to overcome • Recursive freeing • External fragmentation • Reclaiming dead cyclic data structures • Execution speed Increasing Memory Usage in Real-Time GC

  9. Recursive Freeing • The problem was solved for equally sized objects by Weizenbaum (1963) • Decrementing child references is postponed until the memory is reused • Still, all memory is available when it becomes unreachable • However, objects are not always of the same size… Increasing Memory Usage in Real-Time GC

  10. External Fragmentation • As in most file systems, the heap can be divided into equally sized blocks • Small objects are linked using a list, while larger objects use a tree structure • Minor performance penalty for small objects • Weizenbaum’s technique to eliminate recursive freeing can be used on the blocks Increasing Memory Usage in Real-Time GC

  11. Dead Cyclic Data Structures • Manual techniques cover most cases • Breaking cycles • Weak references • Balloon types • Automatic techniques are not real-time • A backup real-time mark-sweep GC can be used but that increases memory overhead Increasing Memory Usage in Real-Time GC

  12. Execution Time • Peep hole optimization • Stack allocation • Object owning (Data flow analysis) Increasing Memory Usage in Real-Time GC

  13. RT-Reference Counting • All operations are predictable in memory usage and execution time • Memory usage is increased by more than 50% for objects larger than 17 bytes • Dead cyclic data structures can be reclaimed (to the cost of memory overhead) Increasing Memory Usage in Real-Time GC

  14. Impact of Block Size Increasing Memory Usage in Real-Time GC

  15. Implementations • Real-Time Reference Counting has been implemented: • As CPP macros • In the JOSES Java compiler • In the Jamaica VM • However more optimizations are required • No backup GC has been implemented Increasing Memory Usage in Real-Time GC

  16. Benchmarks b = dividing objects into blocks bs = spreading the blocks r = using reference counting t = running thousand simulations (= more blocks in use) Increasing Memory Usage in Real-Time GC

  17. Future Work • Full implementation • RT-Mark compact • Memory Usage Analysis • Should critical systems use GC? • Can you not explicitly deallocate all garbage if you can give an upper bound of memory usage? Increasing Memory Usage in Real-Time GC

  18. Conclusion • RT-Reference Counting drastically decrease the memory overhead of real-time systems with a GC • The block size have a minor impact on the memory overhead Increasing Memory Usage in Real-Time GC

  19. Increasing Memory Usage in Real-Time GC Tobias Ritzau and Peter Fritzson Department of Computer and Information Science Linköpings universitet tobri@ida.liu.se http://www.ida.liu.se/~tobri

More Related