1 / 32

Dynamic Object Sampling for Pretenuring

Dynamic Object Sampling for Pretenuring. Maria Jump Department of Computer Sciences The University of Texas at Austin mjump@cs.utexas.edu. Stephen M. Blackburn Department of Computer Science Australia National University Steve.Blackburn@anu.edu.au. Kathryn S. McKinley

ziva
Download Presentation

Dynamic Object Sampling for Pretenuring

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. Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin mjump@cs.utexas.edu Stephen M. Blackburn Department of Computer Science Australia National University Steve.Blackburn@anu.edu.au Kathryn S. McKinley Department of Computer Sciences The University of Texas at Austin mckinley@cs.utexas.edu

  2. Current Trends • Object-oriented languages • Lots of small objects • Runtime system treats them uniformly • Objects have distinctive properties • Lifetime, access frequency, locality, calling context, thread usage, etc. • PROBLEM: How can we discover and exploit object properties? Jump, Blackburn, McKinley

  3. Gathering Object Statistics • Offline statistics • Inconsistent with Java • Obscure phase behavior • Online statistics • Profiling all objects • Dynamic Object Sampling • Statistics only for selected objects • Use to estimate behavior of all objects Jump, Blackburn, McKinley

  4. Example: Using Object Lifetimes for Pretenuring PROBLEM: Long-lived objects are allocated into the nursery SOLUTION: Allocate long-lived objects directly into mature space CHALLENGE: Correlating lifetime behavior with allocation site Jump, Blackburn, McKinley

  5. Outline • Motivation • Dynamic Object Sampling • Mechanism • Dynamic Lifetime Prediction • Accuracy vs. Cost • Dynamic Pretenuring • Allocation Survival Phases • Coverage, Accuracy, and Performance • Conclusions Jump, Blackburn, McKinley

  6. 128 256 384 Dynamic Object Sampling • Modify a bump-pointer allocator • Sample one object every n bytes Memory chunk: Sample Tag (for n=128) Bump Pointer Jump, Blackburn, McKinley

  7. VM_Address alloc(int bytes) throws VM_PragmaInline { VM_Addresss oldCursor = cursor; VM_Address newCursor = oldCursor.add(bytes); if (newCursor.GT(limit)) return allocSlow(bytes); cursor = newCursor; return oldCursor; } Bump-Pointer Allocator VM_Address alloc(int bytes) throws VM_PragmaInline { VM_Addresss oldCursor = cursor; VM_Address newCursor = oldCursor.add(bytes); if (newCursor.GT(sampleLimit)) return sample(bytes); cursor = newCursor; return oldCursor; } Slow Path Sample Path (Intermediate): 1) adds sample tag 2) collects statistics Jump, Blackburn, McKinley

  8. During Garbage Collection • Use GC to update statistics • Trace live objects • Update transient and total statistics survivor What’s in the Sample Tag? SAMPLE TAG FOUND! 1. decode tag word 2. collect statistics Jump, Blackburn, McKinley

  9. Dynamic Lifetime Prediction • Encode allocation site identifier into the object sampling sample tag • Allocation site is a good lifetime predictor [Blackburn et al.] • Compiler maps identifiers to sites • Accuracy vs. Cost tradeoff Jump, Blackburn, McKinley

  10. Implementation and Experimental Methodology • Jikes RVM 2.3.0.1 with MMTk • SPEC JVM benchmarks, SPEC JBB 2000 with constant workload • 3.2 GHz Intel Pentium 4 w/ hyperthreading, 1GB main memory, Linux 2.6.0 • Generational/Mark-Sweep (GenMS) • 4MB bounded nursery • Pseudoadaptive compilation • Report application time only [Eeckhout et al.] • 2nd run methodology Jump, Blackburn, McKinley

  11. Accuracy of Sampling javac Accuracy 92.5% Jump, Blackburn, McKinley

  12. Cost of Sampling Jump, Blackburn, McKinley

  13. if (survival rate >= threshold)then change the allocation target Pretenure: Object Sampling forDynamic Pretenuring • Accurately and efficiently estimate allocation-site lifetimes • At garbage collection time • Calculate survival rate per allocation site • Compute transient and total statistics Jump, Blackburn, McKinley

  14. Dynamic Allocation Target case NURSERY_SPACE: table lookup if (shortLived(site)) region = nursery.alloc(…); else region = matureAlloc(…); break; region = nursery.alloc(…); break; Jump, Blackburn, McKinley

  15. Dynamic Allocation Target Overhead Jump, Blackburn, McKinley

  16. Dynamic Pretenuring Overhead Jump, Blackburn, McKinley

  17. Allocation Phases • Current survival rate is not a guarantee of future survival • Sampling in older space is ineffective • Collections are infrequent • Small amount of allocation Periodically allocate site in nurseryBACKSAMPLING Jump, Blackburn, McKinley

  18. Backsample Trigger * f n = Backsampling • Protects the system from bad choices • Reduces effectiveness of good choices When to Backsample? Growth function: Constant Linear Exponential Number of allocations for pretenuring decision Jump, Blackburn, McKinley

  19. Dynamic Pretenuring Policies Jump, Blackburn, McKinley

  20. Long-Lived Pretenured Pretenuring Threshold None 100% 95% 90% 85% 80% 75% Coverage: How much? Jump, Blackburn, McKinley

  21. Incorrect Correct Pretenuring Threshold None 100% 95% 90% 85% 80% 75% Accuracy: Are we right? Jump, Blackburn, McKinley

  22. GC Time: javac Jump, Blackburn, McKinley

  23. Total Time: javac Jump, Blackburn, McKinley

  24. Conclusions • Lifetime estimation for dynamic pretenuring • Accurately and efficiently estimates allocation-site lifetimes • Pretenuring long-lived allocation-sites can improve runtime • Few opportunities in our programs • Dynamic Object Sampling • Low-overhead • High accuracy • Generic mechanism Jump, Blackburn, McKinley

  25. Questions? Thank You Jump, Blackburn, McKinley

  26. GC Time: jess Jump, Blackburn, McKinley

  27. Total Time: jess Jump, Blackburn, McKinley

  28. Coverage: How much? Jump, Blackburn, McKinley

  29. Accuracy: Are we right? Jump, Blackburn, McKinley

  30. Coverage: How much? Jump, Blackburn, McKinley

  31. Coverage: How much? Jump, Blackburn, McKinley

  32. Coverage: How much? Jump, Blackburn, McKinley

More Related