Meta tags:
Headings (most frequently used words):
2013, monday, thursday, blog, lock, mechanical, sympathy, may, 2014, 26, august, tuesday, 16, july, 27, june, 14, february, search, this, discussion, group, about, me, training, consulting, popular, posts, archive, followers, simple, binary, encoding, based, vs, free, concurrent, algorithms, java, garbage, collection, distilled, printing, generated, assembly, code, from, the, hotspot, jit, compiler, cpu, cache, flushing, fallacy,
Text of the page (most frequently used words):
the (683), and (216), for (182), can (111), are (101), this (91), that (91), with (80), memory (69), cache (67), objects (61), when (59), from (53), have (47), generation (47), #collection (46), not (43), which (43), java (41), latency (40), space (39), concurrent (38), will (38), application (38), old (37), collector (37), time (36), then (34), throughput (33), object (31), all (30), minor (30), more (29), message (29), collections (29), garbage (28), size (28), you (27), data (27), line (27), sbe (27), heap (26), very (26), each (26), some (26), collectors (26), promotion (26), code (25), these (25), live (25), system (24), performance (24), cms (24), new (24), tenured (23), may (22), other (22), has (22), than (22), often (21), parallel (21), run (21), allocation (21), fields (21), messages (20), also (20), world (20), stop (20), been (19), systems (19), lock (19), applications (19), pauses (19), free (19), most (18), major (18), store (18), thread (18), significant (18), cost (17), access (17), your (17), cpu (17), need (17), number (17), read (17), threads (17), such (17), interthreadlatency (17), regions (17), many (16), single (16), share (16), caches (16), core (16), socket (16), algorithms (16), int (16), car (16), use (15), survivor (15), our (15), state (15), used (15), hotspot (15), note (15), encoding (14), how (14), should (14), available (14), instructions (14), being (14), buffer (14), pongrunner (14), final (14), references (14), append (14), main (13), sub (13), version (13), case (13), out (13), over (13), test (13), static (13), but (13), region (13), large (13), stubs (13), because (12), into (12), like (12), known (12), young (12), eden (12), spaces (12), between (12), must (12), long (12), get (12), while (12), generated (12), rate (12), exec (12), thrpt (12), ops (12), times (11), make (11), any (11), see (11), work (11), cores (11), shared (11), design (11), variable (11), possible (11), cycle (11), order (11), value (11), instruction (11), thus (11), buffers (11), set (11), events (11), generational (11), implementation (11), binary (10), back (10), high (10), multiple (10), one (10), within (10), local (10), allocated (10), write (10), full (10), implementations (10), using (10), mark (10), point (10), low (10), less (10), hlt (10), decoding (10), fullgc (10), schema (10), gpb (10), simple (9), load (9), its (9), could (9), algorithm (9), off (9), real (9), tuning (9), via (9), example (9), same (9), effectively (9), both (9), only (9), written (9), protocol (9), does (9), greater (9), compiler (9), allows (9), method (9), volatile (9), sometimes (9), assembly (9), found (9), target (9), would (9), reduced (9), compaction (9), rates (9), keep (8), different (8), gen (8), public (8), hardware (8), older (8), achieve (8), per (8), across (8), registers (8), class (8), copy (8), changes (8), bus (8), ordering (8), require (8), based (8), much (8), what (8), jit (8), jvm (8), due (8), targets (8), strings (8), support (8), pause (8), roots (8), first (8), failure (8), results (8), market (8), protobuf (8), zing (7), financial (7), writer (7), even (7), flush (7), fallacy (7), them (7), server (7), similar (7), larger (7), try (7), consistent (7), controller (7), another (7), ring (7), second (7), issue (7), issues (7), efficient (7), avoid (7), operation (7), generations (7), optimisation (7), few (7), r10 (7), rax (7), here (7), end (7), cannot (7), running (7), footprint (7), collecting (7), during (7), safepoint (7), copying (7), promoted (7), reachable (7), good (7), concurrently (7), length (7), spaceship (7), coordinates (7), xml (7), fix (7), encode (7), decode (7), ncar (7), 2013 (6), requests (6), interesting (6), fast (6), done (6), numbers (6), about (6), perm (6), london (6), martin (6), thompson (6), location (6), x86 (6), bridge (6), processors (6), following (6), qpi (6), modified (6), track (6), return (6), fence (6), addition (6), address (6), two (6), however (6), significantly (6), cycles (6), depending (6), they (6), model (6), figure (6), necessary (6), plugin (6), below (6), mov (6), pointer (6), r11d (6), pong (6), ping (6), amount (6), mostly (6), therefore (6), expect (6), occurs (6), runtime (6), triggered (6), purpose (6), stampedlock (6), encoded (6), codec (6), carbenchmark (6), testdecode (6), testencode (6), marketdatabenchmark (6), message_header (6), blog (5), follow (5), since (5), bytes (5), native (5), language (5), fences (5), important (5), vast (5), takes (5), structures (5), highly (5), having (5), labels (5), pinterest (5), facebook (5), blogthis (5), email (5), comments (5), posted (5), execution (5), programs (5), intel (5), processor (5), sandy (5), non (5), follows (5), coherent (5), never (5), increased (5), requirements (5), previous (5), connected (5), network (5), made (5), there (5), variables (5), loop (5), register (5), achieved (5), user (5), observed (5), context (5), switch (5), required (5), reference (5), indicates (5), level (5), sets (5), additional (5), accessing (5), private (5), entry (5), useful (5), particular (5), appropriate (5), performed (5), makes (5), rather (5), rsp (5), start (5), fly (5), those (5), discussed (5), give (5), reduce (5), mean (5), job (5), milliseconds (5), efficiency (5), result (5), before (5), moved (5), sizes (5), contention (5), tlab (5), occur (5), byte (5), collect (5), sufficient (5), compared (5), mutation (5), seen (5), incremental (5), little (5), tens (5), general (5), typical (5), tool (5), api (5), methods (5), position (5), presentation (5), languages (5), directbuffer (5), schemaid (5), july (4), august (4), under (4), until (4), bit (4), anything (4), channels (4), azul (4), article (4), barriers (4), miss (4), sending (4), compact (4), build (4), principle (4), operations (4), serial (4), next (4), logic (4), coherence (4), common (4), attempt (4), function (4), cpus (4), multi (4), independent (4), process (4), capable (4), allow (4), small (4), executed (4), cross (4), keeping (4), source (4), know (4), separate (4), provides (4), clean (4), writing (4), reasons (4), compilers (4), generate (4), reads (4), sequentially (4), simply (4), setting (4), tlb (4), cases (4), later (4), way (4), usually (4), around (4), enable (4), without (4), come (4), runs (4), take (4), jvms (4), oracle (4), standard (4), linux (4), measure (4), associated (4), above (4), normally (4), followed (4), best (4), 0x0 (4), compiled (4), total (4), repetitions (4), focus (4), commercial (4), great (4), worst (4), frequent (4), trading (4), tend (4), resulting (4), longer (4), tends (4), collected (4), suffer (4), reach (4), array (4), event (4), phase (4), directly (4), proportional (4), fail (4), threshold (4), fixed (4), spent (4), needs (4), increasing (4), uses (4), default (4), suitable (4), consider (4), become (4), compacting (4), fragmentation (4), marking (4), logs (4), remembered (4), jrockit (4), ratio (4), tests (4), mode (4), readers (4), principles (4), header (4), template (4), protocols (4), bufferoffset (4), templateid (4), 2014 (3), pressure (3), doing (3), programming (3), patterns (3), people (3), terms (3), last (3), had (3), trying (3), cause (3), flushing (3), hundreds (3), popular (3), posts (3), view (3), modern (3), limited (3), groups (3), mechanical (3), sympathy (3), search (3), latest (3), resource (3), their (3), huge (3), together (3), hierarchy (3), opportunity (3), means (3), exists (3), taking (3), effective (3), expense (3), amd (3), segment (3), held (3), containing (3), exclusive (3), always (3), relatively (3), telling (3), after (3), issuing (3), put (3), ensure (3), part (3), believe (3), classes (3), flushed (3), whole (3), expensive (3), atomic (3), nehalem (3), forward (3), copies (3), associative (3), hash (3), associativity (3), trade (3), now (3), pre (3), average (3), split (3), segments (3), designed (3), mob (3), floating (3), allocate (3), advantage (3), understand (3), decisions (3), applied (3), install (3), targeting (3), was (3), printing (3), print (3), optimised (3), able (3), field (3), xchg (3), oop (3), 0x00007fed81060a00 (3), stub (3), 0x00007fed810609d0 (3), cmp (3), 0x00007fed81060980 (3), void (3), string (3), pongthread (3), program (3), amd64 (3), find (3), tradeoffs (3), something (3), comes (3), batch (3), seconds (3), maintain (3), short (3), whereas (3), immortal (3), almost (3), age (3), operate (3), managed (3), specific (3), where (3), were (3), meet (3), card (3), table (3), grow (3), bump (3), providing (3), call (3), lists (3), increases (3), gets (3), too (3), adding (3), approach (3), updating (3), maintaining (3), influence (3), range (3), compactions (3), frequency (3), extended (3), constrained (3), websphere (3), advantages (3), millisecond (3), needed (3), least (3), three (3), dynamic (3), spikes (3), update (3), better (3), reader (3), dimensional (3), reentrantreadwritelock (3), provide (3), complex (3), representation (3), move (3), param (3), delta (3), year (3), tag (3), working (3), community (3), todd (3), codecs (3), input (3), decoded (3), blobs (3), root (3), struct (3), repeating (3), metadata (3), sbetool (3), wrap (3), abstraction (3), direct (3), extension (3), alignment (3), overview (3), specification (3), feedback (3), benchmarks (3), 29193 (3), 600 (3), 34078 (3), 646 (3), 11657 (3), 190 (3), 10436 (3), 476 (3), 619 (3), serialnumber (3), modelyear (3), october (2), december (2), 2012 (2), february (2), june (2), respond (2), accepting (2), response (2), applying (2), quite (2), ever (2), turn (2), stream (2), largest (2), penalty (2), communicate (2), receiving (2), formats (2), detailed (2), implications (2), lot (2), quest (2), limitation (2), scalability (2), writers (2), experienced (2), technologists (2), hear (2), talk (2), certain (2), safepoints (2), distilled (2), training (2), consulting (2), profile (2), https (2), google (2), com (2), forum (2), group (2), seems (2), explain (2), execute (2), techniques (2), ends (2), nanoseconds (2), hide (2), exercise (2), others (2), slower (2), developing (2), lost (2), considered (2), stale (2), whereby (2), place (2), works (2), bandwidth (2), tracks (2), finite (2), states (2), employs (2), mesif (2), sent (2), traffic (2), sockets (2), lanes (2), inclusive (2), either (2), worry (2), visibility (2), appear (2), firstly (2), periods (2), repeatedly (2), updates (2), aware (2), ahead (2), sequential (2), impact (2), want (2), think (2), subsequent (2), indexing (2), entries (2), request (2), numa (2), matches (2), transitions (2), involves (2), plus (2), stage (2), tables (2), ways (2), hashed (2), levels (2), uniform (2), maybe (2), remote (2), hop (2), westmere (2), aggregated (2), link (2), individual (2), accesses (2), through (2), addresses (2), acts (2), queue (2), contains (2), 32k (2), already (2), waiting (2), searched (2), existing (2), transferred (2), writes (2), stores (2), expected (2), files (2), integers (2), accessible (2), constitute (2), fastest (2), given (2), located (2), thursday (2), debugging (2), previously (2), installed (2), programmer (2), sufficiently (2), reading (2), situation (2), once (2), again (2), reordered (2), add (2), stack (2), semantics (2), action (2), efficiently (2), oopmap (2), jmpq (2), runtime_call (2), 0x00007fed81060a0a (2), handler (2), exception (2), iload_1 (2), eax (2), rip (2), 0x00007fed8ba77000 (2), rbp (2), 0x10 (2), 102 (2), jne (2), 0x00007fed810609c0 (2), r9d (2), goto (2), nopl (2), lang (2), constants (2), 0x00007fed81060850 (2), 0x00007fed81060b28 (2), 0x00007fed81060b30 (2), scopes (2), 0x00007fed81060a78 (2), 0x00007fed81060a30 (2), 0x00007fed81060a18 (2), unlockdiagnosticvmoptions (2), 1000 (2), throws (2), duration (2), runtest (2), pingthread (2), pingrunner (2), nanotime (2), implements (2), runnable (2), busy (2), spin (2), hsdis (2), disassembler (2), flags (2), tune (2), describing (2), every (2), choosing (2), usage (2), play (2), missed (2), acceptable (2), regardless (2), workloads (2), occasionally (2), period (2), behavior (2), lived (2), magnitude (2), likely (2), sparse (2), survived (2), generates (2), spending (2), portion (2), happens (2), living (2), lower (2), distinct (2), checks (2), executing (2), reached (2), potentially (2), eventually (2), basis (2), behind (2), wrong (2), adjust (2), avoiding (2), cheap (2), commences (2), fit (2), differently (2), dead (2), include (2), internal (2), survive (2), potential (2), 512 (2), stored (2), cards (2), scan (2), empty (2), area (2), copied (2), doubling (2), increase (2), heaps (2), starting (2), greatest (2), fills (2), effort (2), prevent (2), accommodate (2), fullgcs (2), experience (2), linearly (2), perform (2), 7u4 (2), extent (2), tolerate (2), compacted (2), gain (2), goal (2), driven (2), worse (2), taken (2), grows (2), phases (2), check (2), requires (2), introduced (2), supported (2), humongous (2), moving (2), referenced (2), evacuating (2), problem (2), well (2), scenarios (2), alternative (2), still (2), truly (2), higher (2), side (2), analysis (2), histogram (2), jhiccup (2), lifetimes (2), printgcapplicationstoppedtime (2), maxgcpausemillis (2), reset (2), sweep (2), updated (2), initial (2), maxtenuringthreshold (2), xmx (2), maximum (2), concurrency (2), session (2), optimistic (2), current (2), fact (2), indirection (2), built (2), harness (2), pattern (2), inlining (2), employed (2), variance (2), produce (2), especially (2), interface (2), provided (2), attempts (2), xdelta (2), axis (2), ydelta (2), monday (2), feeds (2), gives (2), ascii (2), presentations (2), complain (2), cme (2), who (2), format (2), grouped (2), sniffer (2), bitsets (2), enums (2), arrays (2), type (2), body (2), offsets (2), block (2), optional (2), supporting (2), unsafe (2), carry (2), otherwise (2), aligned (2), parts (2), structure (2), otf (2), developers (2), don (2), welcome (2), 1316 (2), 123 (2), 2088 (2), 998 (2), 433 (2), 711 (2), 467 (2), msg (2), 1242 (2), 252 (2), 1148 (2), 050 (2), 326 (2), 018 (2), 462 (2), 817 (2), thr (2), cnt (2), sec (2), error (2), units (2), messagetemplateversion (2), actingblocklength (2), blocklength (2), actingversion (2), stringbuilder (2), sbetemplateid (2), sbeschemaversion (2), jar (2), powered, blogger, followers, september, november, 2011, march, april, january, archive, sustained, deadly, hockey, overloaded, leaving, lmax, neglecting, opposi, fun, nirvana, wish, serialisation, discuss, fundamental, technique, computing, said, post, tuples, scalable, biggest, contend, item, course, www, complete, technology, geek, exploring, capabilities, development, services, twitter, mjpt777, united, kingdom, discussion, subscribe, atom, home, heirarchy, illustrating, interacts, fulfil, interact, concrete, dive, accessed, 10s, 100s, 100ns, 0ghz, 1200, retiring, ipc, employ, capacity, persistent, pondering, 500, double, interconnects, circa, servers, decomposed, truth, mainstream, fetched, master, style, management, evicted, blocks, reduces, variant, transition, series, effect, greatly, days, buses, module, integrated, graphics, rapid, identification, snooping, keeps, owns, wants, snooped, guaranteed, why, modifications, visible, qualifying, beware, inadequate, reorder, shortly, likes, overcome, let, accompanied, preventing, progress, drained, marker, boundary, vega, opposed, returning, safely, say, drain, policy, arm, armv6, did, tags, requiring, kept, bottom, switching, topic, pollution, lazyset, peterson, dekker, acknowledge, snoop, hypertransport, opteron, specialised, designated, unused, invalid, exclusively, ownership, rfo, invalidate, broadcast, dirty, moesi, l1d, masking, bits, handle, collision, slot, slots, hold, storing, power, 40ns, step, limit, raised, 4gt, 0gt, eliminating, bottleneck, delivered, choke, fetch, dram, 65ns, extremely, columns, row, queuing, effects, refresh, conflict, pipelining, 2mb, 20mb, inclusiveness, intercept, removing, burden, 256k, hidden, pipelined, comprised, flight, fully, queued, blocking, disambiguate, compliance, published, loads, ordered, constructed, according, 160, 144, arguments, subset, expands, ability, streams, enabled, hyperthreads, hyperthreading, architectural, asm, profiling, determining, affect, knowing, emitted, rules, bugs, various, illustrates, command, options, obtain, debug, sun, steps, executes, hot, details, optimise, honour, statement, forest, trees, generally, twice, osr, red, highlighted, lines, optimisations, staging, inserting, chosen, enforce, idiom, ideal, correctly, wonder, compromises, portable, architectures, observation, oopmapset, oopmaps, 0x00007fed81060a17, 0x00007fed81060a16, 0x00007fed81060a15, 0x00007fed81060a14, 0x00007fed81060a0f, 0x00007fed81038c00, subq, 0x5, 0x00007fed81060a05, callq, deopt, 0x00007fed8105eaa0, no_reloc, 0x00007fed810609ff, 0x00007fed810609fe, 0x00007fed810609fd, 0x00007fed810609fc, 0x00007fed810609fb, 0x00007fed810609fa, 0x00007fed810609f9, retq, poll_return, 0x00007fed810609f3, 0xaa16607, 0x00007fed810609f2, pop, 0x00007fed810609ee, 0x00007fed810609ec, if_icmpeq, 0x00007fed810609e5, 0x5f5e100, 0x00007fed810609e2, inc, iinc, 0x00007fed810609dd, addl, putstatic, 0x00007fed810609d9, 0x78, 0x00007fed810609d7, 0x00007fed810609d4, 000, 0x74, getstatic, 0x00007fed810609c6, nopw, poll, 0xaa1663a, 0x00007fed810609bb, 0x00007fed810609b9, jmp, 0x00007fed810609af, 0x7ad0fcbf0, 0x00007fed810609ac, xor, 0x00007fed810609a7, synchronization, 0x00007fed810609a0, 0x18, verified, 0x00007fed8106099c, 0x00007fed81060994, 0x00007fed81060991, 0x00007fed8106098b, 0x00007fed81037a60, 0x00007fed81060988, 0x00007fed81060984, shl, 0x3, 0x8, rsi, r10d, 0x20, caller, dependencies, pcs, 176, oops, 128, relocation, 0x00007fed81060970, 736, 10531, compilecommand, printassembly, import, 100, args, printf, dns, avg, interruptedexception, join, library, java_home, jre, lib, rename, libhsdis, download, kenai, projects, base, downloads, installation, startup, baffle, alone, documentation, feels, man, pages, aircraft, knob, dial, explained, nowhere, guide, workload, openjdk, ones, towards, illustrate, alternatives, wise, folk, silently, continue, warning, margin, distribution, interpret, term, lowest, refers, deterministic, processing, matter, paused, overall, completed, sooner, virtually, human, facing, interactive, goes, unresponsive, spell, disaster, worthwhile, physical, fronts, expectation, percentage, theory, iterators, experimentation, shown, ubiquitously, separating, newly, scavenges, record, consistently, fairly, filter, frequently, practical, engineering, periodically, points, varying, durations, bring, signaling, contents, returns, edges, optimized, away, places, making, dynamically, rare, cloning, monotonic, counted, bound, ttsp, consideration, surfaced, enabling, flag, undergo, scheduling, resume, released, reliance, explore, organised, initially, temporary, described, collectively, enough, knows, unfortunately, loading, ongoing, motivating, assumption, interned, treat, virtual, statistics, accordingly, assigned, allocates, tlabs, scale, bumps, roughly, platforms, cheaper, malloc, exhausted, filled, accommodated, created, handles, own, section, becomes, tenuring, overflows, iteratively, frames, graphs, graph, processed, sure, identifying, existence, corresponding, barrier, indicate, exist, represent, alternate, roles, beginning, includes, dominated, dealt, halved, doubled, traded, constant, rapidly, becoming, majority, variety, filling, predict, fill, begin, passed, promoting, unwound, padding, promotions, resizing, avoided, simplest, option, smallest, forms, multiprocessor, affected, retain, fewer, port, employing, collects, five, benefits, allocating, shame, feature, trigger, multistep, unreachable, reclaimed, sized, hole, holes, logged, reducing, brought, performing, sees, extremes, reduction, carried, fails, caused, late, addressed, might, officially, partially, tries, smaller, minimize, plague, organizes, dividing, 2000, contiguous, increments, costly, date, challenge, remember, marked, slow, down, scanned, patched, 200ms, efforts, futile, tendency, fragmented, regional, fall, just, evacuation, evacuated, challenging, dealing, heavily, choice, mid, called, look, clear, regularly, occurring, unsuitable, strict, reactive, interfaces, ibm, limitations, author, shifts, related, contained, digit, including, allowing, apply, fear, rule, thumb, budget, warranted, today, seldom, behaving, settings, nature, launch, jvisualvm, visual, understanding, applcations, representative, grips, configurations, experiments, perspective, capturing, outside, correlate, determine, causing, idle, hours, surprised, invest, combined, skilled, verses, purchasing, disruptor, hdrhistogram, chewiebug, verbose, xloggc, printgcdetails, printgcdatestamps, printtenuringdistribution, printgcapplicationconcurrenttime, monitoring, overflow, useg1gc, failures, failed, reclaiming, occupied, capture, remarking, useconcmarksweepgc, usenuma, useparalleloldgc, useparallelgc, useserialgc, xms, promotedpadding, pretenuresizethreshold, permgen, organisation, weak, hypothesis, infant, mortality, managing, controlling, inducing, amortized, active, retained, parameter, responding, impacted, equating, gctimeratio, nothing, tuesday, locks, week, attended, review, excellent, unconference, arise, attending, couple, things, occurred, thought, reviewed, status, secondly, although, looks, jdk, solution, compare, favour, atomically, transaction, cleaner, factoring, immutable, create, minimal, easily, exercised, coarsening, unrolling, subjected, threading, profiles, 0_25, quad, 2ghz, ivy, 3632qm, measured, repeated, warm, throughputs, averaged, approximate, deployment, affinity, isolation, operating, raw, charts, surprise, beyond, balance, takeaways, nice, seeing, appearing, strategy, evidenced, teaching, conclusion, offer, careful, measurement, reentrantlock, counts, discovered, synchronised, easy, mistakenly, locking, actions, improvement, megamorphic, dispatch, ship, readposition, jcrete, heinz, kabutz, jsr166, big, really, lets, quantify, finance, industry, exchanges, typically, emitting, thousands, aggregate, peak, million, volumes, growing, crazy, slightly, sane, markets, commit, sin, income, ultra, parsers, member, commissioned, 29west, lbm, fame, myself, aimed, addressing, coming, atonement, sins, past, worked, helped, net, amazing, cool, technical, team, dream, layer, spend, parsing, transforming, json, business, adhering, features, offered, consists, environment, log, viewer, drive, ensures, streamed, backtracking, unnecessary, underestimated, reclamation, applies, totally, predictable, 25ns, 1000ns, orders, sweet, spot, structured, restrictions, usability, users, suited, preserve, streaming, backtrack, insert, pointers, types, indirected, extra, losing, prefetchers, pure, identifies, nest, finally, define, characters, composites, repeat, currently, output, defined, flyweight
Text of the page (random words):
sign a spaceship that can be moved around a 2 dimensional space with the coordinates of its position available to be read atomically at least 2 fields need to be read or written per transaction to make the concurrency interesting interface to a concurrent representation of a ship that can move around a 2 dimensional space with updates and reads performed concurrently public interface spaceship read the position of the spaceship into the array of coordinates provided param coordinates into which the x and y coordinates should be read return the number of attempts made to read the current state int readposition final int coordinates move the position of the spaceship by a delta to the x and y coordinates param xdelta delta by which the spaceship should be moved in the x axis param ydelta delta by which the spaceship should be moved in the y axis return the number of attempts made to write the new coordinates int move final int xdelta final int ydelta the above api would be cleaner by factoring out an immutable position object but i want to keep it garbage free and create the need to update multiple internal fields with minimal indirection this api could easily be extended for a 3 dimensional space and require the implementations to be atomic multiple implementations are built for each spaceship and exercised by a test harness all the code and results for this blog can be found here the test harness will run each of the implementations in turn by using a megamorphic dispatch pattern to try and prevent inlining lock coarsening and loop unrolling when accessing the concurrent methods each implementation is subjected to 4 distinct threading scenarios that result in different contention profiles 1 reader 1 writer 2 readers 1 writer 3 readers 1 writer 2 readers 2 writers all tests are run with 64 bit java 1 7 0_25 linux 3 6 30 and a quad core 2 2ghz ivy bridge i7 3632qm throughput is measured over 5 second periods for each implementation with the tests repeated 5 times to ensure sufficient warm up the results below are throughputs averaged per second over 5 runs to approximate a typical java deployment no thread affinity or core isolation has been employed which would have reduced variance significantly note other cpus and operating systems can produce very different results results figure 1 figure 2 figure 3 figure 4 the raw data for the above charts can be found here analysis the real surprise for me from the results is the performance of reentrantreadwritelock i cannot see a use for this implementation beyond a case whereby there is a huge balance of reads and very little writes my main takeaways are stampedlock is a major improvement over existing lock implementations especially with increasing numbers of reader threads stampedlock has a complex api it is very easy to mistakenly call the wrong method for locking actions synchronised is a good general purpose lock implementation when contention is from only 2 threads reentrantlock is a good general purpose lock implementation when thread counts grow as previously discovered choosing to use reentrantreadwritelock should be based on careful and appropriate measurement as with all major decisions measure and make decisions based on data lock free implementations can offer significant throughput advantages over lock based algorithms conclusion it is nice seeing the influence of lock free techniques appearing in lock based algorithms the optimistic strategy employed on read is effectively a lock free algorithm at the times when a writer is not updating in my experience of teaching and developing lock free algorithms not only do they provide significant throughput advantages as evidenced here they also provide much lower and less variance in latency posted by martin thompson at 11 48 50 comments email this blogthis share to x share to facebook share to pinterest labels algorithms concurrency java lock free locks performance location london uk tuesday 16 july 2013 java garbage collection distilled serial parallel concurrent cms g1 young gen new gen old gen perm gen eden tenured survivor spaces safepoints and the hundreds of jvm startup flags does this all baffle you when trying to tune the garbage collector while trying to get the required throughput and latency from your java application if it does then do not worry you are not alone documentation describing garbage collection feels like man pages for an aircraft every knob and dial is detailed and explained but nowhere can you find a guide on how to fly this article will attempt to explain the tradeoffs when choosing and tuning garbage collection algorithms for a particular workload the focus will be on oracle hotspot jvm and openjdk collectors as those are the ones in most common usage towards the end other commercial jvms will be discussed to illustrate alternatives the tradeoffs wise folk keep telling us you do not get something for nothing when we get something we usually have to give up something in return when it comes to garbage collection we play with 3 major variables that set targets for the collectors throughput the amount of work done by an application as a ratio of time spent in gc target throughput with xx gctimeratio 99 99 is the default equating to 1 gc time latency the time taken by systems in responding to events which is impacted by pauses introduced by garbage collection target latency for gc pauses with xx maxgcpausemillis n memory the amount of memory our systems use to store state which is often copied and moved around when being managed the set of active objects retained by the application at any point in time is known as the live set maximum heap size xmx n is a tuning parameter for setting the heap size available to an application note often hotspot cannot achieve these targets and will silently continue without warning having missed its target by a great margin latency is a distribution across events it may be acceptable to have an increased average latency to reduce the worst case latency or make it less frequent we should not interpret the term real time to mean the lowest possible latency rather real time refers to having deterministic latency regardless of throughput for some application workloads throughput is the most important target an example would be a long running batch processing job it does not matter if a batch job is occasionally paused for a few seconds while garbage collection takes place as long as the overall job can be completed sooner for virtually all other workloads from human facing interactive applications to financial trading systems if a system goes unresponsive for anything more than a few seconds or even milliseconds in some cases it can spell disaster in financial trading it is often worthwhile to trade off some throughput in return for consistent latency we may also have applications that are limited by the amount of physical memory available and have to maintain a footprint in which case we have to give up performance on both latency and throughput fronts tradeoffs often play out as follows to a large extent the cost of garbage collection as an amortized cost can be reduced by providing the garbage collection algorithms with more memory the observed worst case latency inducing pauses due to garbage collecting can be reduced by containing the live set and keeping the heap size small the frequency with which pauses occur can be reduced by managing the heap and generation sizes and by controlling the application s object allocation rate the frequency of large pauses can be reduced by concurrently running the gc with the application sometimes at the expense of throughput object lifetimes garbage collection algorithms are often optimised with the expectation that most objects live for a very short period of time while relatively few live for very long in most applications objects that live for a significant period of time tend to constitute a very small percentage of objects allocated over time in garbage collection theory this observed behavior is often known as infant mortality or the weak generational hypothesis for example loop iterators are mostly short lived whereas static strings are effectively immortal experimentation has shown that generational garbage collectors can usually support an order of magnitude greater throughput than non generational collectors do and thus are almost ubiquitously used in server jvms by separating the generations of objects we know that a region of newly allocated objects is likely to be very sparse for live objects therefore a collector that scavenges for the few live objects in this new region and copies them to another region for older objects can be very efficient hotspot garbage collectors record the age of an object in terms of the number of gc cycles survived note if your application consistently generates a lot of objects that live for a fairly long time then expect your application to be spending a significant portion of its time garbage collecting and expect to be spending a significant portion of your time tuning the hotspot garbage collectors this is due to the reduced gc efficiency that happens when the generational filter is less effective and resulting cost of collecting the longer living generations more frequently older generations are less sparse and as a result the efficiency of older generation collection algorithms tends to be much lower generational garbage collectors tend to operate in two distinct collection cycles minor collections when short lived objects are collected and the less frequent major collections when the older regions are collected stop the world events the pauses that applications suffer during garbage collection are due to what are known as stop the world events for garbage collectors to operate it is necessary for practical engineering reasons to periodically stop the running application so that memory can be managed depending on the algorithms different collectors will stop the world at specific points of execution for varying durations of time to bring an application to a total stop it is necessary to pause all the running threads garbage collectors do this by signaling the threads to stop when they come to a safepoint which is a point during program execution at which all gc roots are known and all heap object contents are consistent depending on what a thread is doing it may take some time to reach a safepoint safepoint checks are normally performed on method returns and loop back edges but can be optimized away in some places making them more dynamically rare for example if a thread is copying a large array cloning a large object or executing a monotonic counted loop with a finite bound it may be many milliseconds before a safepoint is reached time to safepoint ttsp is an important consideration in low latency applications this time can be surfaced by enabling the xx printgcapplicationstoppedtime flag in addition to the other gc flags note for applications with a large number of running threads when a stop the world event occurs a system will undergo significant scheduling pressure as the threads resume when released therefore algorithms with less reliance on stop the world events can potentially be more efficient heap organisation in hotspot to understand how the different collectors operate it is best to explore how the java heap is organised to support generational collectors eden is the region where most objects are initially allocated the survivor spaces are a temporary store for objects that have survived a collection of the eden space survivor space usage will be described when minor collections are discussed collectively eden and the survivor spaces are known as the young or new generation objects that live long enough are eventually promoted to the tenured space the perm generation is where the runtime stores objects it knows to be effectively immortal such as classes and static strings unfortunately the common use of class loading on an ongoing basis in many applications makes the motivating assumption behind the perm generation wrong i e that classes are immortal in java 7 interned strings were moved from permgen to tenured and from java 8 the perm generation is no more and will not be discussed in this article most other commercial collectors do not use a separate perm space and tend to treat all long living objects as tenured note the virtual spaces allow the collectors to adjust the size of regions to meet throughput and latency targets collectors keep statistics for each collection phase and adjust the region sizes accordingly in an attempt to reach the targets object allocation to avoid contention each thread is assigned a thread local allocation buffer tlab from which it allocates objects using tlabs allows object allocation to scale with number of threads by avoiding contention on a single memory resource object allocation via a tlab is a very cheap operation it simply bumps a pointer for the object size which takes roughly 10 instructions on most platforms heap memory allocation for java is even cheaper than using malloc from the c runtime note whereas individual object allocation is very cheap the rate at which minor collections must occur is directly proportional to the rate of object allocation when a tlab is exhausted a thread simply requests a new one from the eden space when eden has been filled a minor collection commences large objects xx pretenuresizethreshold n may fail to be accommodated in the young generation and thus have to be allocated in the old generation e g a large array if the threshold is set below tlab size then objects that fit in the tlab will not be created in the old generation the new g1 collector handles large objects differently and will be discussed later in its own section minor collections a minor collection is triggered when eden becomes full this is done by copying all the live objects in the new generation to either a survivor space or the tenured space as appropriate copying to the tenured space is known as promotion or tenuring promotion occurs for objects that are sufficiently old xx maxtenuringthreshold n or when the survivor space overflows live objects are objects that are reachable by the application any other objects cannot be reached and can therefore be considered dead in a minor collection the copying of live objects is performed by first following what are known as gc roots and iteratively copying anything reachable to the survivor space gc roots normally include references from application and jvm internal static fields and from thread stack frames all of which effectively point to the application s reachable object graphs in generational collection the gc roots for the new generation s reachable object graph also include any references from the old generation to the new generation these references must also be processed to make sure all reachable objects in the new generation survive the minor collection identifying t...
|