Taming the Memory Hogs: Using Compiler-Inserted Releases to Manage Physical Memory Intelligently - PowerPoint PPT Presentation

About This Presentation
Title:

Taming the Memory Hogs: Using Compiler-Inserted Releases to Manage Physical Memory Intelligently

Description:

Taming the Memory Hogs: Using Compiler-Inserted Releases to Manage Physical Memory Intelligently Angela Brown and Todd Mowry Carnegie Mellon University – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 15
Provided by: ams130
Category:

less

Transcript and Presenter's Notes

Title: Taming the Memory Hogs: Using Compiler-Inserted Releases to Manage Physical Memory Intelligently


1
Taming the Memory Hogs Using Compiler-Inserted
Releases to Manage Physical Memory Intelligently
  • Angela Brown and Todd Mowry
  • Carnegie Mellon University
  • Presented by Peter Amstutz

2
Ten Pounds of Stuff in a Five Pound Bag
  • Huge data sets
  • Insufficient RAM
  • Virtual memory, paging
  • Impact other processes
  • Resource competition

3
Virtual Memory
  • I/O latency
  • Pre-fetch pages
  • Release pages
  • App knows best
  • Help the OS
  • Extra work
  • automate in compiler

4
Working Together
  • OS support
  • Access page tables
  • Compiler Support
  • Insert pre-fetch, release hints
  • Not perfect
  • Augment with run-time system

5
An Example
for (i 0 i lt N i) for (j 0 j lt N
j) aij (ai1j-1 ai1j
ai1j1 aij-1 aij
aij1 ai-1j-1 ai-1j
ai-1j1) / 9.0
  • Ideally with each inner loop iteration
  • Pre-fetch ai1j1
  • Release ai-1j-1
  • Requires compiler be aware of array dimensions
    and physical memory available!

6
Prototype Implementation
  • Modular extension to IRIX 6.5
  • Exposes page status information
  • How many physical pages it is using
  • Suggested maximum of pages

7
Behaviors
  • Pre-Fetch
  • only satisfy if there is free memory
  • Release
  • Ready to be replaced queue
  • Remain in physical memory
  • Revivified if accessed
  • Prioritized

8
Compiler Analysis
  • Reuse Analysis
  • Locality Analysis
  • Loop Splitting
  • Software Pipelining

9
Runtime System
  • Adaptive
  • Compensate for compiler mistakes
  • Buffers releases
  • Prioritized queues
  • Higher priority needed again sooner

10
Results
  • Selected five applications
  • Data significantly larger than physical RAM
  • With Pre-fetching
  • avoided I/O stall in 85 of test cases
  • reduces OS overhead by avoiding page faults

11
Results (cont.)
  • Pre-fetching releases
  • Reduced total run time between 30 and 60
  • Interactive apps could remain in memory

12
Pros
  • Significant performance increase
  • Limits overall memory use
  • No changes to existing app
  • Reduces OS overhead from page faults

13
Cons
  • Requires special OS support
  • Only works for arrays
  • Doesnt handle pointer-based structures
  • Useless for linked lists!
  • What about the the memory allocator?
  • not malloc/free aware

14
Conclusion
  • Too much data, not enough memory
  • Apps help out the OS
  • Compiler inserts data pre-fetch and release
  • Adaptive run-time system
  • Reduces thrashing, improves performance, plays
    nicely with other apps on the system
Write a Comment
User Comments (0)
About PowerShow.com