Download presentation
Presentation is loading. Please wait.
Published byMagdalen Charles Modified over 6 years ago
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 App knows best Extra work Pre-fetch pages
Release pages App knows best Help the OS Extra work automate in compiler
4
Working Together OS support Compiler Support Not perfect
Access page tables Compiler Support Insert pre-fetch, release hints Not perfect Augment with run-time system
5
An Example for (i = 0; i < N; i++) { for (j = 0; j < N; j++) {
a[i][j] = (a[i+1][j-1] + a[i+1][j] + a[i+1][j+1] + a[i][j-1] + a[i][j] a[i][j+1] + a[i-1][j-1] + a[i-1][j] + a[i-1][j+1]) / 9.0; } Ideally with each inner loop iteration: Pre-fetch a[i+1][j+1] Release a[i-1][j-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 Release only satisfy if there is free memory
“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 With Pre-fetching
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
Doesn’t 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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.