


























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



























































































Haim Yadid, Head of Performance and Application Infra Group
GC Me allocate myObject = new MyClass(2015) GC cleans So everything is cool!
Garbage collector memory overhead Internal structures Additional memory required for GC Policy and amount of memory generated before GC
Pause Time Garbage collector stops the application During that time the application is not responsive What is the maximal delay your application can sustain: Batch applications seconds… Web applications ½ second? Swing UI 100 ms max Trading application milliseconds Robotics microseconds….
Memory footprint Throughput Max pause time Garbage Collectors: G Contradicting! Choose 2 of 3
TLAB - thread local allocation buffer Maintaining locality utilizes CPU cache Linear allocation mechanism Per thread buffer allocated on first object alloc after new Gen GC. Small objects allocated linearly on that buffer FAST 10 machine instructions Resized automatically ( ResizeTLAB=true) Based on TLABWasteTargetPercent=
An object which is references from outside the heap or heap region. Java Local JNI Native stack System class Busy monitor Etc…
Live Set : Object that are reachable from garbage collection roots #LS - number of object in the live set |LS| - The size of live set
Pauseless Collector (Concurrent Collector ) vs Stop the world (STW) Collector Serial Collector -Single threaded vs Parallel collector -Multi threaded Incremental vs Monolithic Conservative vs Precise
A point in thread execution where it is safe for a GC to operate References inside thread stacks are identifiable If a thread is in a safe point GC may commence Thread will not be able to exit a safe-point until GC ends Global Safe-point : All threads enter a safe point Safe points must be frequent
Mark: O(#LS) Same as mark and sweep Copy: O(|LS|) = O(#LS) All live objects are copied to an empty region(to space) No fragmentation Downside: Need twice as much memory Copy is very expensive STW - mutators cannot work at the same time as copy A B C^ D^ F^ A^ B^ C^ D^ F from space to space
Building Blocks: Mark (Sweep)Compact Mark: O(#LS) Same as mark&sweep Sliding compaction O(|H|+|LS|) move objects (relocate) fix pointers(remap) Compact to the beginning of the heap Do not need twice the memory Copy is more delicate and may be slower