1 / 28

Using Generational Garbage Collection To Implement Cache-conscious Data Placement

This paper presents a method using generational garbage collection to organize data for improved cache locality. It discusses copying GC, generational GC, real-time profiling, affinity graphs, and a cache-conscious copying algorithm.

eliab
Download Presentation

Using Generational Garbage Collection To Implement Cache-conscious Data Placement

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. Using Generational Garbage Collection To Implement Cache-conscious Data Placement Trishul M. Chilimbi & James R. Larus מציג : ראובן ביק

  2. Introduction • Main memory access cost is increasing • goal : to improve cache locality • introducing a technique for using a (copying) generational GC to reorganize data, so that objects with high temporal affinity are placed next to each other and thus are likely to reside in the same cache block

  3. Contents • background • copying GC • generational GC • the method • profiling instrumentation • affinity graph • algorithm steps • results & conclusions

  4. Copying GC • Two memory areas • When FROMSPACE is full, moves all the live objects from FROMSPACE to TOSPACE

  5. Copying GC

  6. Copying GC (cheney algorithm) • Breadth-first scan of the tree • one continuous scan of TOSPACE

  7. Copying GC (cheney algorithm)

  8. Why Generational GC ? • Most objects live a very short time, while a small percentage of them live much longer • problem : repeated copying of old objects

  9. Generational GC • segregating objects into multiple areas by age • scavenge older objects less frequently • copy long surviving objects to older generations

  10. Real time data access profiling • Real time profiling is more effective then an earlier training run • must be low overhead • done by modified compiler • upon access , the object address is written into an object access buffer

  11. Real time data access profiling

  12. Profiling is low-overhead • Implemented at object, not field, granularity • most object accesses are not lightweight

  13. Affinity graph • Is based on object access buffer • created prior to scavenge • separate graph for each generation • nodes=objects • edges=affinity between objects

  14. ADFGDACCAFDGAC A 1 D

  15. ADFGDACCAFDGAC A 1 F 1 1 D

  16. ADFGDACCAFDGAC A 1 F 1 1 1 G D 1

  17. ADFGDACCAFDGAC A 1 F 1 1 2 G D 2

  18. Cache-conscious copying algorithm Step1: • From the set of roots, pick the one with the highest affinity edge • perform a greedy depth first traversal of the affinity graph starting from this node • while traversing, copy each visited object to TOSPACE

  19. Cache-conscious copying algorithm Step2: • Process all objects between the unprocessed and free pointers, using Cheney algorithm

  20. Cache-conscious copying algorithm Step3: • Cleanup : copy any roots not present to TOSPACE and process using Cheney algorithm

  21. this algorithm is not used in the youngest generation (where new objects are allocated and most of the garbage is generated)

  22. Results • Tested on 5 Cecil language programs • on a Sun computer with 2GB memory, with 2 level cache, running Solaris

  23. Conclusions • This is an attractive technique that reduces cache miss rates by 21-42% and improves program performance by 14-37% , as compared to the commonly used alternative.

More Related