50 likes | 120 Views
Users always get it wrong?. Explicit MM is a rich source of bugs Dangling pointers Double delete, etc So use Garbage Collection Eliminates these errors (But doesn’t prevent leaks) Supports better software engineering GC gives users little control System.gc() Widely used/advocated
E N D
Users always get it wrong? • Explicit MM is a rich source of bugs • Dangling pointers • Double delete, etc • So use Garbage Collection • Eliminates these errors • (But doesn’t prevent leaks) • Supports better software engineering • GC gives users little control • System.gc() • Widely used/advocated • But JVM can ignore it • We GCers know better…? ISMM’04 Wild and Crazy
Allocation control • No need for any handle on allocation policy? • Universal panaceas • Generational GC • Incremental/concurrent GC • Troublesome, middle-aged objects? • But one rule for us, another for them… • Large object spaces • Immortal areaspublicstatic int pickAllocator(VM_Type type, VM_Method m) { VM_Class cls = m.getDeclaringClass();byte[] clsBA = cls.getDescriptor().toByteArray();if (isPrefix("Lorg/mmtk/", clsBA)) return Plan.IMMORTAL_SPACE; MMType t = (MMType) type.getMMType();return t.getAllocator(); // Plan.DEFAULT_SPACE } ISMM’04 Wild and Crazy
Users do know some things r t • Semantics • Phases, Longevity, Connectivity • Lifetime ~ allocation site • Allocation policies • System provided? User-defined? • Safety: Hints not orders • Syntax • Scoped memory? policy.enter(); … policy.exit(); • Marker Interface? class Foo implements PolicyIF {…} • Placement new? Foo^ o = new (policy) Foo(); • Tools • Users need better tools to guide optimisation ISMM’04 Wild and Crazy
GC bibliography • Proposal: • Anyone who writes a GC-related paper, or who discovers a GC-related paper that is not in • http://www.cs.kent.ac.uk/people/staff/rej/gcbib/ • should send a bibtex entry for the paper to • R.E.Jones@kent.ac.uk • Failure to do so should incur a forfeit of buying Richard Jones a drink at the next ISMM. ISMM’04 Wild and Crazy