File size: 1,430 Bytes
b27bfb3 | 1 2 3 4 5 | {"type": "session", "harness": "opencode", "id": "lang-0040", "name": "JVM Internals and GC"}
{"type": "message", "message": {"role": "system", "content": "You are an expert software engineer."}}
{"type": "message", "message": {"role": "user", "content": "How does the JVM work internally?"}}
{"type": "message", "message": {"role": "assistant", "content": "JVM architecture:\n1. Class Loader: loads .class files, verifies, prepares, resolves\n2. Runtime Data Area: method area, heap, stack, PC registers, native method stack\n3. Execution Engine: interpreter + JIT compiler\n\nMemory model:\n- Young Generation: Eden + Survivor spaces (S0, S1)\n- Old Generation: long-lived objects\n- Metaspace: class metadata (replaces PermGen in Java 8)\n- Thread stacks: local variables, method calls\n\nJIT compilation:\n- C1 (Client): fast compilation, basic optimizations\n- C2 (Server): slower compilation, aggressive optimizations\n- Graal JIT: experimental, ahead-of-time potential\n\nGarbage Collectors:\n- Serial: single-threaded, stop-the-world, small heaps\n- Parallel: multi-threaded, stop-the-world\n- G1: region-based, balanced latency/throughput\n- ZGC: ultra-low latency (<10ms pauses), TB heaps\n- Shenandoah: concurrent compaction, low pause\n\nClass loading: bootstrap -> extension -> application -> custom.\nDelegation model: parent-first loading.\n\nJVM Language: bytecode instructions, stack machine architecture."}}
|