DOC PREVIEW
UT CS 395T - Leak Pruning

This preview shows page 1-2-16-17-18-34-35 out of 35 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 35 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 35 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 35 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 35 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 35 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 35 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 35 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 35 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1MotivationMotivationMotivationMotivationMotivationMotivationMotivationPossible SolutionsLeak PruningLeak PruningLeak PruningLeak PruningLeak PruningLeak PruningLeak PruningLeak PruningLeak PruningLeak PruningLeak PruningState Diagram for Leak PruningOBSERVE StateOBSERVE StateSELECT StatePRUNE StateIntercepting Accesses to Pruned ReferencesEvaluationApplication + Collection OverheadGarbage Collection OverheadCompilation OverheadTolerating LeaksSlide 32Slide 33Slide 34DiscussionLeak PruningMichael Bond Kathryn McKinleyThe University of Texas at AustinPresented by Na MengMost of the slides are from Mike’s original talk. Many thanks go to the authors.MotivationMemory bugsMemory corruption: dangling pointers, double frees, buffer overflowsMemory leaks▪Lost objects: unreachable but not freed▪Useless objects: reachable but not used2Managed languagesManaged languagesMotivationMemory leaks are a real problemManaged languages do not eliminate them3ReachableUnreachableMotivationMemory leaks are a real problemManaged languages do not eliminate them4LiveLiveReachableDeadMotivationMemory leaks are a real problemManaged languages do not eliminate them5LiveLiveReachableDeadMotivationMemory leaks are a real problemManaged languages do not eliminate them6LiveLiveReachableDeadMotivationMemory leaks are a real problemManaged languages do not eliminate themSlow & crash real programs7LiveLiveDeadMotivationMemory leaks are a real problemManaged languages do not eliminate themSlow & crash real programsFixing leaks is hardLeaks take time to materializeFailure far from cause8Leaks exist in production softwareLeak PruningLeak PruningPossible SolutionsPrecisely determine liveness of objectsLiveness is in general undecidableApproximately treat stale objects as dead9Leak Pruning10LiveLiveReachableDeadLeak Pruning11LiveLiveReachableDeadLeak Pruning12LiveLiveReachableDeadLeak Pruning13LiveLiveDeadThrow OOM errorThrow OOM errorOut of memory!Out of memory!ReachableLeak Pruning14LiveLiveDeadOut of memory!Out of memory!Throw OOM errorThrow OOM errorReclaim some objectsReclaim some objectsReachableLeak PruningReclaim predicted dead objects15ReclaimedLiveLiveLeak PruningReclaim predicted dead objects16ReclaimedLiveLiveaabbLeak PruningReclaim predicted dead objectsPoison references to reclaimed objects17LiveLiveaa?Leak PruningReclaim predicted dead objectsPoison references to reclaimed objects18LiveLiveaaLeak PruningReclaim predicted dead objectsPoison references to reclaimed objects19LiveLiveaaXThrow InternalError with OOMError attachedThrow InternalError with OOMError attachedLeak PruningReclaim predicted dead objectsPoison references to reclaimed objects20LiveLiveaaXThrow InternalError with OOMError attachedThrow InternalError with OOMError attachedWorst case: defers fatal errorsWorst case: defers fatal errorsBest case: keeps leaky programs running indefinitelyBest case: keeps leaky programs running indefinitelyPreserves semanticsPreserves semanticsState Diagram for Leak Pruning21INACTIVEOBSERVESELECTPRUNEHeap not nearly full<50% Heap filled>50%Heap not fullHeap nearly full>90%Heap still nearly fullOBSERVE StateTracking stalenesso.staleCounter increments from k to k + 1 after 2k garbage collectionsRead barrier22o.staleCounterHeader001b = a.f; //Application codeif (b & 0x1){ // Read barrier //out-of-line code path t = b; // Save ref b &= ~0x1; // Clear lowest bit a.f = b;[iff a.f == t] // Atomic b.staleCounter = 0x0; //Atomic}How does staleCounter’s increment work?OBSERVE StateMaintaining edge table23a0a0b11b11srcclass tgtclassmaxStaleUsebytesUsedb22b22A  B20b = a.f; //Application codeif (b & 0x1){ // Read barrier //out-of-line code path t = b; // Save ref b &= ~0x1; // Clear lowest bit a.f = b;[iff a.f == t] // Atomic b.staleCounter = 0x0; //Atomic} if (b.staleCounter > 1){//set maxStaleUse edgeTable[a.class->b.class].maxStaleUse = max(edgeTable[a.class->b.class].maxStaleUse, b.staleCounter);} if (b.staleCounter > 1){//set maxStaleUse edgeTable[a.class->b.class].maxStaleUse = max(edgeTable[a.class->b.class].maxStaleUse, b.staleCounter);}SELECT StateTransitive ClosurePhase I: in-use transitive closurePhase II: stale transitive closure24srcclass tgtclassmaxStaleUsebytesUsedB  C 0E  C 2a10a10b10b10c13c13rootse10e10b20b20c23c23d13d13d23d23b30b30c33c33▪Enque candidate ref if tgt.staleCounter > 2 + ref.maxStaleUse▪Compute the bytes reachable from each stale candidate6080PRUNE StateIn-use transitive closureCollector poisons each reference25a10a10b10b10c13c13rootse10e10b20b20c23c23d13d13d23d23b30b30c33c33srcclass tgtclassmaxStaleUsebytesUsedB  C 0 80E  C 2???Intercepting Accesses to Pruned References26a10a10b10b10rootse10e10b20b20b30b30c33c33Read barrier checks for poisoned referencesb = a.f; //Application codeif (b & 0x1){ // Read barrier //out-of-line code path if (b.staleCounter > 1){ edgeTable[a.class->b.class].maxStaleUse = max(edgeTable[a.class->b.class].maxStaleUse, b.staleCounter);} if (b & 0x2){//Check if poisoned InternalError error = new InternalError(); err.initCause(avertedOutofMemoryError); throw err; if (b & 0x2){//Check if poisoned InternalError error = new InternalError(); err.initCause(avertedOutofMemoryError); throw err;XThrow InternalError ???Evaluation27Leaking pruning added to Jikes RVM 2.9.2http://www.jikesrvm.org/Research+ArchiveGenerational Mark-Sweep in MMTkPerformance stress testNon-leaking programs: Dacapo & SPECReplay compilationLeak tolerance testLeaking programsApplication + Collection Overhead28SELECT State5% overhead on Pentium 43% overhead on Core 2Why overhead is negative for some benchmarks ?Garbage Collection OverheadOBSERVE State 5%SELECT State 14%29Compilation OverheadInsert read barrier17% on average, 34% at mostNegligible compared with overall execution time30Tolerating Leaks31Leak Leak pruning’s effectEclipse “Diff” Tolerates until 24-hr limit (>200X longer)ListLeak Tolerates until 24-hr limit (>25,000X longer)SwapLeak Tolerates until 24-hr limit (>2,200X longer)Eclipse “Copy-Paste” Most dead but some live (81X


View Full Document

UT CS 395T - Leak Pruning

Documents in this Course
TERRA

TERRA

23 pages

OpenCL

OpenCL

15 pages

Byzantine

Byzantine

32 pages

Load more
Download Leak Pruning
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Leak Pruning and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Leak Pruning 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?