VisualWorks ObjectMemory Management      Andrés Valloud
Structure
Eden
SAEden       SB
SAEden       SBOld
SAEden       SBOldPerm
Evolution
Instancecreation
Scavenge 1
Scavenge 2
Scavenge 3
Scavenge 4
Tenured
IGC / GC
Perm save
Global GC            R IP
But, speaking of GC...
SAEden       SBOldPerm
Scavenge finds                            SA live objects        Eden                            SB     faster             ...
Scavenge finds                             SA live objects         Eden                             SB     faster          ...
Responsibilities
SA      Eden             SBRT    OldOld      PermRT
VM scavenges                SA                     Eden new space                  SB               RT    Old             ...
VM scavenges                SA   VI must ensure                     Eden new space                  SB      success       ...
VM scavenges                  SA   VI must ensure                       Eden new space                    SB      successV...
VM scavenges                  SA   VI must ensure                       Eden new space                    SB      successV...
VM scavenges                  SA   VI must ensure                       Eden new space                    SB      successV...
Memory policies
Worst case                SA                   Edenscavenge                  SB             RT    Old             Old     ...
Worst case                SA    Eden and                   Edenscavenge                  SB   SA or SB full             RT...
Worst case                SA    Eden and                   Edenscavenge                  SB   SA or SB full             RT...
Worst case                SA    Eden and                   Edenscavenge                  SB   SA or SB full             RT...
Worst case                                SA    Eden and   scavenge              Eden                                SB   ...
The picture                       Worst Case                       Scavenge                               Upper0          ...
The picture          Growth          Worst Case        Increments        Scavenge                                  Upper0 ...
Improvements since  VisualWorks 7.7
Fixed since VW 7.7ObjectMemory>>igcState ... aborting ifTrue: [^#aborting]. ...MemoryPolicy>>dealWithIGC ... memoryStatus ...
Fixed since VW 7.7ObjectMemory>>igcState ... aborting ifTrue: [^#aborting]. ...                                      IGC d...
Fixed since VW 7.7                        Worst Case                        Scavenge                                Upper0...
Fixed since VW 7.7 IGC as lastresort, bogusemergencies              Worst Case                         Scavenge           ...
Fixed since VW 7.7VM crash due to scavenge    failure             Worst Case                        Scavenge              ...
Fixed since VW 7.7Too low for  modernapplications            Worst Case                        Scavenge                   ...
Fixed since VW 7.7          Growth        Worst Case        Increments      Scavenge                                Upper0...
Fixed since VW 7.7Tiny growth increment,excessive GC            Worst Case                        Scavenge                ...
Fixed since VW 7.7 Tiny growth  increment,fragmentation            Worst Case                         Scavenge            ...
Fixed since VW 7.7   Low freememory limit,even more GC            Worst Case                        Scavenge              ...
New technology
E S T SNew technology  T
E S T SNew technology    T•MemoryPolicyChecker
E S T SNew technology    T•MemoryPolicyChecker•MemoryPolicyTuner
E S T SNew technology     T•MemoryPolicyChecker•MemoryPolicyTuner•MemoryPolicyStressTest
Before and after
Before             Upper0            Memory             Bound             Upper0            Memory             Bound    Af...
Run time per stress test case, in seconds40,00030,00020,00010,000    0         A (x100) B (x100) C (x400)       D (x40)   ...
Print 2 web, ESUG 2009
Print 2 web, ESUG 2009                   X               2.5x faster                (with small               changes only)
VisualWorks 7.8  and beyond
VisualWorks 7.8+•Fixed space allocation fixed•Improved weak / ephemeron support•IGC performance improvements•GC / IGC mark ...
VisualWorks 7.8+•Fixed space allocation fixed                  N E•Improved weak / ephemeron support                O      ...
VisualWorks 7.9
VisualWorks 7.9•Up to 40% faster GC
VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory
VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory•Adaptive time based memory policy IGC driver
VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory•Adaptive time based memory policy IGC driver•Memory poli...
VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory•Adaptive time based memory policy IGC driver•Memory poli...
VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory•Adaptive time based memory policy IGC driver•Memory poli...
VisualWorks 7.9•Up to 40% faster GC                 O N E•Improved IGC uses less memory         D•Adaptive time based memo...
Questions?
VW Object Memory Management
Upcoming SlideShare
Loading in …5
×

VW Object Memory Management

772 views

Published on

ESUG 2011, Edinburgh

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
772
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

VW Object Memory Management

  1. 1. VisualWorks ObjectMemory Management Andrés Valloud
  2. 2. Structure
  3. 3. Eden
  4. 4. SAEden SB
  5. 5. SAEden SBOld
  6. 6. SAEden SBOldPerm
  7. 7. Evolution
  8. 8. Instancecreation
  9. 9. Scavenge 1
  10. 10. Scavenge 2
  11. 11. Scavenge 3
  12. 12. Scavenge 4
  13. 13. Tenured
  14. 14. IGC / GC
  15. 15. Perm save
  16. 16. Global GC R IP
  17. 17. But, speaking of GC...
  18. 18. SAEden SBOldPerm
  19. 19. Scavenge finds SA live objects Eden SB faster RT Old Perm
  20. 20. Scavenge finds SA live objects Eden SB faster RT OldIGC / GC find Old live objects Perm RT faster
  21. 21. Responsibilities
  22. 22. SA Eden SBRT OldOld PermRT
  23. 23. VM scavenges SA Eden new space SB RT Old Old Perm RT
  24. 24. VM scavenges SA VI must ensure Eden new space SB success RT Old Old Perm RT
  25. 25. VM scavenges SA VI must ensure Eden new space SB successVM signals low memory RT Old semaphore Old Perm RT
  26. 26. VM scavenges SA VI must ensure Eden new space SB successVM signals low VI manages old memory RT Old space (GC, semaphore grow, shrink) Old Perm RT
  27. 27. VM scavenges SA VI must ensure Eden new space SB successVM signals low VI manages old memory RT Old space (GC, semaphore grow, shrink) VM (few) Old VI memory Perm policy classes fixed actions RT
  28. 28. Memory policies
  29. 29. Worst case SA Edenscavenge SB RT Old Old Perm RT
  30. 30. Worst case SA Eden and Edenscavenge SB SA or SB full RT Old Old Perm RT
  31. 31. Worst case SA Eden and Edenscavenge SB SA or SB full RT Old RT grows Old Perm RT
  32. 32. Worst case SA Eden and Edenscavenge SB SA or SB full RT Old RT grows Old Perm Old RT grows RT
  33. 33. Worst case SA Eden and scavenge Eden SB SA or SB full due to GC Stack RT Old RT growsStack zone full, flushed toobject memory Old Perm Old RT grows RT
  34. 34. The picture Worst Case Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  35. 35. The picture Growth Worst Case Increments Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  36. 36. Improvements since VisualWorks 7.7
  37. 37. Fixed since VW 7.7ObjectMemory>>igcState ... aborting ifTrue: [^#aborting]. ...MemoryPolicy>>dealWithIGC ... memoryStatus igcState = #aborted ifTrue: [“recover from IGC abort”]. ...
  38. 38. Fixed since VW 7.7ObjectMemory>>igcState ... aborting ifTrue: [^#aborting]. ... IGC does not recover from stack overflowMemoryPolicy>>dealWithIGC ... memoryStatus igcState = #aborted ifTrue: [“recover from IGC abort”]. ...
  39. 39. Fixed since VW 7.7 Worst Case Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  40. 40. Fixed since VW 7.7 IGC as lastresort, bogusemergencies Worst Case Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  41. 41. Fixed since VW 7.7VM crash due to scavenge failure Worst Case Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  42. 42. Fixed since VW 7.7Too low for modernapplications Worst Case Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  43. 43. Fixed since VW 7.7 Growth Worst Case Increments Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  44. 44. Fixed since VW 7.7Tiny growth increment,excessive GC Worst Case Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  45. 45. Fixed since VW 7.7 Tiny growth increment,fragmentation Worst Case Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  46. 46. Fixed since VW 7.7 Low freememory limit,even more GC Worst Case Scavenge Upper0 Memory Bound Growth Image Emergency Regime Size Threshold Bound
  47. 47. New technology
  48. 48. E S T SNew technology T
  49. 49. E S T SNew technology T•MemoryPolicyChecker
  50. 50. E S T SNew technology T•MemoryPolicyChecker•MemoryPolicyTuner
  51. 51. E S T SNew technology T•MemoryPolicyChecker•MemoryPolicyTuner•MemoryPolicyStressTest
  52. 52. Before and after
  53. 53. Before Upper0 Memory Bound Upper0 Memory Bound After
  54. 54. Run time per stress test case, in seconds40,00030,00020,00010,000 0 A (x100) B (x100) C (x400) D (x40) E (x40) F (x6) G (x6) VW 7.7 legacy MemoryPolicy (with fixes) ~1 day, if they work VW 7.7.1 without sizesAtStartup tuning ~160 minutes VW 7.7.1 default ~73 minutes A: pointer garbage Segmented container Large container B: byte garbage D: byte allocation F: byte allocation C: point creation E: pointer allocation G: pointer allocation
  55. 55. Print 2 web, ESUG 2009
  56. 56. Print 2 web, ESUG 2009 X 2.5x faster (with small changes only)
  57. 57. VisualWorks 7.8 and beyond
  58. 58. VisualWorks 7.8+•Fixed space allocation fixed•Improved weak / ephemeron support•IGC performance improvements•GC / IGC mark stack overflow prevention•GC moves large objects back into large space•New -m[1..7] VM switches
  59. 59. VisualWorks 7.8+•Fixed space allocation fixed N E•Improved weak / ephemeron support O D•IGC performance improvements•GC / IGC mark stack overflow prevention•GC moves large objects back into large space•New -m[1..7] VM switches
  60. 60. VisualWorks 7.9
  61. 61. VisualWorks 7.9•Up to 40% faster GC
  62. 62. VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory
  63. 63. VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory•Adaptive time based memory policy IGC driver
  64. 64. VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory•Adaptive time based memory policy IGC driver•Memory policy IGC smart abort
  65. 65. VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory•Adaptive time based memory policy IGC driver•Memory policy IGC smart abort•Memory policy IGC switch
  66. 66. VisualWorks 7.9•Up to 40% faster GC•Improved IGC uses less memory•Adaptive time based memory policy IGC driver•Memory policy IGC smart abort•Memory policy IGC switch•Updates to the OldRT, become:, fixed space...
  67. 67. VisualWorks 7.9•Up to 40% faster GC O N E•Improved IGC uses less memory D•Adaptive time based memory policy IGC driver•Memory policy IGC smart abort•Memory policy IGC switch•Updates to the OldRT, become:, fixed space...
  68. 68. Questions?

×