1. Exceptionhistorical

    1. Exception hierarchy 2. Java exception handling 3. References

  2. How to Handle Exceptions Elegantlyhistorical

    1. An inelegant approach 2. An elegant approach

  3. BloomFilterhistorical

    1. Usage 2. Source analysis 3. References

  4. How Lombok Workshistorical

    1. JSR 269 2. Principle

  5. Introductionhistorical

    Why MyBatis exists and its execution flow

  6. Spring Cloudhistorical

    What Spring Cloud is and a reference.

  7. Spring Learning Resourceshistorical

    Spring interview questions with detailed answers; how Spring resolves circular dependencies.

  8. Spring Boothistorical

    Spring + auto-configuration, a framework for quickly starting projects.

  9. 2.7 Introductionhistorical

    Spring MVC components and request-processing flow.

  10. RateLimiterhistorical

    1. What it is 2. Usage 3. Source analysis 4. Summary 5. References

  11. Usagehistorical

    Create a Maven project, configure MyBatis, create the mapper, test it, and inspect the project structure

  12. 2.10 Spring Moduleshistorical

    Spring core container, data access/integration, Web, AOP, Instrumentation, Test, and miscellaneous modules.

  13. Spring Boot Learning Resourceshistorical

    20 Spring Boot interview questions - Java Technology Stack - SegmentFault.

  14. 2.12 Usagehistorical

    Create a Spring MVC project in two ways, configure Maven and Spring MVC, add controllers/JSP/HTML, configure Tomcat, and run the project.

  15. MyBatis Source Analysishistorical

    Framework layers, four core objects, SqlSessionFactory configuration parsing, SqlSession and Executor creation, mapper proxy creation, CRUD execution, mapped statements, first-level and second-level cache, and JDBC execution.

  16. Spring MVC Source Analysishistorical

    Breakpoint call stack, servlet class relationships, DispatcherServlet loading, request dispatch, HandlerMapping, HandlerAdapter, handler invocation, and view rendering.

  17. Learning Resourceshistorical

    Reference: MyBatis interview questions

  18. Thread Safetyhistorical

    Thread-safety issues caused by Spring MVC singleton beans, solutions, and a reference.

  19. Spring MVC Learning Resourceshistorical

    Common Spring MVC interview questions with detailed answers - CSDN Blog.

  20. Usagehistorical

    1. Create the project 2. pom.xml 3. Code

  21. Netty 3.x Source Analysishistorical

    1. Overview 2. Boss-array initialization 3. Worker-array initialization 4. Bind

  22. 2.20 Apollohistorical

    What Apollo is, how to use it, and how its push-pull configuration update mechanism works.

  23. Eurekahistorical

    1. What it is 2. Usage 3. Principles 4. Problems 5. References

  24. Feignhistorical

    What Feign is, why it exists, and how its interface proxy, Ribbon, Eureka, and HTTP request construction work.

  25. Gatewayhistorical

    What Spring Cloud Gateway is, its Route/Predicate/Filter concepts, and its asynchronous non-blocking thread model.

  26. Hystrixhistorical

    1. What Hystrix is 2. Why Hystrix is needed 3. Usage 4. Features 5. Principles 6. References

  27. 2.25 Ribbonhistorical

    What Ribbon is, why load balancing is needed, usage, working flow, and load-balancing strategies.

  28. 2.26 Sleuthhistorical

    What Spring Cloud Sleuth is and how it works with Zipkin.

  29. Zuulhistorical

    1. What it is 2. Usage 3. Principles 4. Zuul 1 vs Zuul 2 5. References

  30. ApplicationListenerhistorical

    1. What ApplicationListener is 2. How to use the event-listener mechanism 3. References

  31. Bean Scopeshistorical

    1. Scope categories 2. Why prototype exists 3. References

  32. Usagehistorical

    1. Create the project 2. pom.xml 3. Code

  33. Usagehistorical

    1. Create the project 2. pom.xml 3. Code

  34. 2.32 Autowired Principlehistorical

    Class inheritance diagram and principle analysis of Spring's AutowiredAnnotationBeanPostProcessor.

  35. Spring Transaction Source Analysishistorical

    1. Enable transaction management. 2. TransactionManagementConfigurationSelector imports AutoProxyRegistrar and ProxyTransactionManagementConfiguration. 3. Study AutoProxyRegistrar. 4. Study ProxyTransactionManagementConfiguration and transaction interception.

  36. 2.34 Custom Startershistorical

    Two questions behind a custom Spring Boot starter and a complete hello-spring-boot-starter example.

  37. 2.35 Usagehistorical

    Create a project, configure pom.xml, and use Spring Boot caching with Application, TestController, and TestService.

  38. Spring Boot Jar Startup Principlehistorical

    1. Experiment. 2. Structure of an executable Jar. 3. How the program entry point is found. 4. Jar packages that can start without the java -jar command. 5. Reference.

  39. MyBatis Auto-Configurationhistorical

    How Spring Boot enables MyBatis auto-configuration and how AutoConfiguredMapperScannerRegistrar determines which package to scan for @Mapper interfaces.

  40. Spring MVC Auto-Configuration Principlehistorical

    1. Auto-configuration classes pre-imported by spring-boot-starter-web. 2. How custom configuration takes effect. 3. Why @EnableWebMvc disables Spring Boot MVC auto-configuration. 4. Reference.

  41. 2.39 Usagehistorical

    Create a project, configure pom.xml, and write Application.java.

  42. Embedded Tomcat Auto-Configuration Principlehistorical

    1. Enable ServletContainer auto-configuration. 2. Inject the Tomcat container factory. 3. How custom configuration takes effect. 4. How to modify Tomcat configuration. 5. Summary.

  43. Learning Resourceshistorical

    Netty learning resources

  44. Summaryhistorical

    Historical Netty source-analysis summary diagrams

  45. 2.43 Thread Isolationhistorical

    Why thread isolation is needed, isolation modes, and thread-pool versus semaphore isolation.

  46. Bean Lifecyclehistorical

    1. Process 2. Usage 3. References

  47. What Spring AOP Ishistorical

    1. What AOP is 2. Implementation principle

  48. What It Ishistorical

    1. Explanation of IoC 2. Implementation principle 3. Benefits of IoC

  49. 2.47 Common Spring Annotationshistorical

    Common Spring annotations and Aware interfaces, including Configuration, ComponentScan, Bean, Scope, Lazy, Conditional, Import, Value, Autowired, Qualifier, Primary, and Profile.

  50. Spring Transaction Propagationhistorical

    1. What transaction propagation is. 1.1. Propagation behaviors including REQUIRED, SUPPORTS, MANDATORY, REQUIRES_NEW, NOT_SUPPORTED, and NEVER. 1.2. Notes. 2. References.

  51. Spring Boot Cache Auto-Configuration Principlehistorical

    How the cache manager and cache classes are generated, how cache proxy classes are generated, and the overall execution flow.

  52. Component Introductionhistorical

    1. What it is 2. Components 3. Processing flow 4. ChannelPipeline

  53. Off-Heap Memoryhistorical

    1. What off-heap memory is 2. NIO off-heap memory 3. Netty off-heap memory 4. References

  54. BeanFactoryhistorical

    1. BeanFactory and ApplicationContext 2. References

  55. 2.53 Usagehistorical

    Create a project, configure pom.xml, and use Spring transactions with DbConfig, TestService, and TestDao.

  56. Circular Dependencieshistorical

    1. What a circular dependency is 2. What problems it causes 3. How to solve it 4. References

  57. How to Load Beans A and B in Order in Springhistorical

    1. Use @DependsOn 2. References

  58. 2.56 1. Create NioEventLoopGrouphistorical

    NioEventLoopGroup class hierarchy, constructor chain, initialization of selector/select strategy/rejection policy, EventLoop count, executor, child EventLoops, and chooser.

  59. 2. Bootstrap Creationhistorical

    1. Code to analyze 2. Create ServerBootstrap 3. Set ServerBootstrap properties 4. ReflectiveChannelFactory

  60. 3. Bind the Porthistorical

    1. Code to analyze 2. Server binds the port

  61. 1. Detect a New Connectionhistorical

    1. Set a breakpoint 2. New connection enters

  62. Pipeline Initializationhistorical

    1. When pipeline is created 2. What pipeline looks like 3. Tail and Head

  63. 1. Creating the Serverhistorical

    bind, channelFactory, and creation of NioServerSocketChannel

  64. 1. Create the Spring Containerhistorical

    1. Code to analyze 2. Create ApplicationContext and trace the refresh process

  65. Spring Boot Startup Principlehistorical

    1. Start Spring Boot. 2. Process of creating SpringApplication: determine web environment, load ApplicationContextInitializer and ApplicationListener instances, save the main configuration class, and run the application.

  66. Create Executorhistorical

    1. Code to analyze 2. Create the thread factory 3. Create the executor

  67. 2. Create NioSocketChannelhistorical

    1. Code to analyze 2. NioSocketChannel constructor

  68. Adding and Removing ChannelHandlershistorical

    1. Add a handler 2. Remove a handler

  69. 2. Server Initializationhistorical

    Call path and ServerBootstrap.init

  70. 2. Call BeanFactoryPostProcessor's postProcess Methodhistorical

    1. Code to study 2. Process BeanDefinitionRegistryPostProcessors 3. Process BeanFactoryPostProcessors

  71. Spring Boot Auto-Configuration Principlehistorical

    1. Enable Spring Boot auto-configuration. 2. Inject AutoConfigurationImportSelector into the container and import auto-configuration classes from META-INF/spring.factories. 3. Summary. 4. Reference.

  72. Create the NioEventLoop Arrayhistorical

    1. Code to analyze 2. Parameters passed to NioEventLoop 3. NioEventLoop is a single-threaded thread pool 4. Constructor

  73. 3. Allocate a Thread and Register the Selectorhistorical

    1. Code to analyze 2. Propagate through the pipeline 3. Pass through ServerBootstrapAcceptor 4. Analyze channelRead

  74. 3. Register the Selectorhistorical

    Call path and event-loop registration

  75. 3. Register BeanPostProcessorhistorical

    1. Code to study 2. Obtain BeanPostProcessors 3. Classify them 4-7. Register each group

  76. 4. Register Read Events with the Selectorhistorical

    1. Code to analyze 2. Set a breakpoint and connect with nc 3. Propagate channelActive 4. Reach HeadContext 5. Read through AbstractUnsafe

  77. 4. Bind the Server Porthistorical

    Call path, AbstractBootstrap, AbstractUnsafe, and AbstractNioChannel

  78. Spring IoC Source: Instantiating All Non-Lazy Singleton Beanshistorical

    Source tracing of finishBeanFactoryInitialization and preInstantiateSingletons through getBean, singleton lookup and creation, BeanPostProcessors, bean instantiation, property population, initialization, proxy creation, and destruction registration.

  79. Server Startuphistorical

    Historical server-startup diagram

  80. UML Diagramhistorical

    Spring IoC UML diagram

  81. 2.79 1. Instantiate the Channelhistorical

    Instantiate NioServerSocketChannel through reflection, configure it as non-blocking, and create channelId, Unsafe, and pipeline.

  82. Netty Bind Source: Actually Binding the Listening Porthistorical

    1. Code to analyze. 1.1. How NioEventLoop executes the Runnable. 1.2. What the bind task executed by NioEventLoop does, including JDK NIO bind, channelActive propagation, and registering interest in accept events.

  83. Inbound Eventshistorical

    1. Add handlers for the experiment 2. Start from the pipeline 3. Forward through AbstractChannelHandlerContext 4. Enter HeadContext 5-8. Traverse inbound handlers to TailContext

  84. ByteBufhistorical

    Data structure, API, class hierarchy, and classification

  85. 1. Inject AspectJAnnotationAutoProxyCreator into the Containerhistorical

    Enable AOP, register AspectJAnnotationAutoProxyCreator, and trace when ImportBeanDefinitionRegistrar.registerBeanDefinitions is called

  86. 2.1 How the AnnotationAwareAspectJAutoProxyCreator Bean Instance Is Createdhistorical

    Class hierarchy, call-stack analysis, BeanFactoryAware setBeanFactory, registration and initialization of AnnotationAwareAspectJAutoProxyCreator

  87. Spring AOP Source Analysis Summaryhistorical

    Created on Monday, July 22, 2019. Source analysis of Spring AOP from @EnableAspectJAutoProxy through auto-proxy creation and target-method interceptor execution.

  88. 2. Initialize Channelhistorical

    1. Code to analyze 2. Obtain the channel pipeline and add a ChannelInitializer

  89. Netty Source: NioEventLoop run Methodhistorical

    Code analysis of the NioEventLoop run loop: select, selector rebuild, selected-key optimization, processSelectedKeys, and asynchronous task execution.

  90. Outbound Eventshistorical

    1. Add handlers for the experiment 2. Start from the pipeline 3. Enter TailContext 4-7. Traverse outbound handlers back to HeadContext

  91. ByteBufAllocatorhistorical

    ByteBufAllocator class hierarchy, AbstractByteBufAllocator, unpooled allocation, and pooled allocation

  92. 2.2 When Does AnnotationAwareAspectJAutoProxyCreator Take Effect?historical

    Trace postProcessBeforeInstantiation and postProcessAfterInitialization while creating singleton Beans

  93. 2.91 3. Register the Channelhistorical

    Select a NioEventLoop, create a ChannelPromise/Future, register the channel through Unsafe with the JDK NIO selector, and invoke handlerAdded/initChannel callbacks.

  94. Exception Eventshistorical

    1. Prepare experiment data 2. Start debugging 3-7. Propagate the exception through handlers to TailContext

  95. Usagehistorical

    Historical example of allocating, reading, writing, and releasing a pooled direct ByteBuf

  96. 2.3 How AnnotationAwareAspectJAutoProxyCreator Creates Proxy Objectshistorical

    Trace to postProcessBeforeInstantiation, determine whether a proxy is needed, wrap the Bean with advisors, and create JDK/CGLIB proxies

  97. Channel Class Hierarchyhistorical

    1. Channel class hierarchy 2. Config class hierarchy

  98. 2.4 How the Target Method Is Executedhistorical

    Invoke Calc.div, enter the proxy intercept method, build the interceptor chain, and execute interceptors plus the target method

  99. PooledByteBufAllocatorhistorical

    newDirectBuffer, PoolThreadLocalCache, PoolThreadCache, and PoolArena

  100. PoolThreadCachehistorical

    Constructor and the tiny, small, and normal MemoryRegionCache groups

  101. 3.1 Comparison of the Three I/O Modelshistorical

    Relationship between Java I/O and system calls, BIO/NIO/AIO classification, comparison, and references.

  102. 3.2 Multithreaded Server Implemented with BIOhistorical

    Traditional server-side programming with BIO and its blocking points.

  103. AIOhistorical

    Asynchronous NIO classes and AsynchronousFileChannel examples for reading and writing with Future polling and CompletionHandler callbacks.

  104. 3.4 BIOhistorical

    Basic concepts: input/output, streams, and I/O for different purposes.

  105. Bufferhistorical

    Basic Buffer usage and the meanings of capacity, position, and limit.

  106. 3.6 Server Implemented with NIOhistorical

    NIO vs BIO and common questions about channel reads, selector.select, and SelectionKey.OP_WRITE.

  107. AIO Serverhistorical

    1. Example: server and client. 2. Reference.

  108. Basic Streamshistorical

    Byte streams with InputStream and OutputStream, and character streams with Reader and Writer.

  109. Channelhistorical

    Basic Channel usage.

  110. 3.10 Serialization Protocolhistorical

    What serialization is, a custom ByteBuffer-based serialization rule, and a complete custom Serializer example.

  111. File Streamshistorical

    Writing, reading, and metadata for file streams.

  112. Fileshistorical

    Check whether a file exists, create directories, copy files, move or rename files, delete files, and recursively traverse files.

  113. Heartbeat Mechanismhistorical

    For servers, periodically clear idle channels; for clients, detect disconnected sessions and whether to reconnect.

  114. BIO Serverhistorical

    1. Example: server and client. 2. Reference.

  115. 3.15 NIOhistorical

    Basic concepts: Channel and Buffer, Channel, Buffer, NIO, and Selector.

  116. Packet Protocolhistorical

    What sticky packets and split packets are, why the phenomenon appears with TCP byte streams, and how application-layer framing solves it.

  117. Pathhistorical

    What Path is, absolute paths, and relative paths.

  118. NIO Serverhistorical

    1. Example: server and client. 2. Reference.

  119. enumhistorical

    What enum is, how to use it, and a source-level look at java.lang.Enum.

  120. switchhistorical

    Supported types and source analysis of switch over int, char, and String.

  121. transienthistorical

    Used during serialization. Fields marked transient are not serialized; after deserialization they take their initial values such as null or 0.

  122. finalhistorical

    Usage of final on classes, methods, and variables.

  123. Cloneable and Object.clonehistorical

    1. What the Cloneable interface is. 2. What object cloning is. 3. How to implement object cloning: shallow cloning and deep cloning. 4. References.

  124. 5.2 Integerhistorical

    Usage and implementation analysis of Integer, including immutability, valueOf, IntegerCache, and autoboxing behavior.

  125. 5.3 ArrayListhistorical

    What ArrayList is, how to use it, and source analysis of construction, add, remove, resizing, and fail-fast behavior.

  126. 5.4 Hashtablehistorical

    What Hashtable is, how to use it, and source analysis of construction, synchronized put/get/remove/containsKey, hashing, chaining, and rehashing.

  127. Objecthistorical

    Methods on Object, the equals/hashCode contract, and the difference between wait and sleep.

  128. PriorityQueuehistorical

    1. What PriorityQueue is. 2. Usage. 3. Source analysis: fields, constructors, heapify, insertion, deletion, sift-up, and sift-down. 4. Reference.

  129. 5.7 Serializablehistorical

    Serialization and deserialization in Java, custom readObject/writeObject hooks, implementation flow, serialVersionUID, and serialization algorithm.

  130. 5.8 HashSethistorical

    What HashSet is, how to use it, source analysis, and summary.

  131. Stringhistorical

    1. What String is. 2. Usage. 3. Source analysis: class definition, constructors, constant pool, equals, toCharArray, toString, valueOf, intern, and substring. 4. Common questions. 5. References.

  132. 5.10 LinkedListhistorical

    What LinkedList is, usage, and source analysis of its doubly linked list, add/remove operations, and node traversal.

  133. LinkedHashMaphistorical

    What LinkedHashMap is, insertion-order and access-order usage, and source analysis of construction, put, get, contains, remove, and iteration.

  134. Immutable Objecthistorical

    How to create an immutable object.

  135. LinkedHashSethistorical

    Usage, constructor, fields, other methods, and summary of LinkedHashSet.

  136. StringBufferhistorical

    1. What It Is: a thread-safe mutable string, essentially StringBuilder with synchronized methods. 2. Usage. 3. Implementation analysis: constructor, append, toString, and substring.

  137. Converting Between List and Arrayhistorical

    Convert Array to List and List to Array.

  138. Java Map Implementations Comparedhistorical

    Comparison of HashMap 1.7 and 1.8, HashMap and Hashtable, and TreeMap, LinkedHashMap, and HashMap.

  139. Collections.synchronizedSethistorical

    Synchronized Set wrappers and the need for external synchronization during compound operations and iteration.

  140. StringBuilderhistorical

    1. What It Is: a mutable, thread-unsafe string. 2. Usage. 3. Implementation analysis: constructor, append, toString, and substring.

  141. List Comparisonhistorical

    Comparison of ArrayList and LinkedList, Vector and ArrayList, and SynchronizedList and Vector.

  142. Collections.synchronizedMaphistorical

    Synchronized Map wrappers, compound-operation atomicity, iteration locking, and concurrent alternatives.

  143. TreeSethistorical

    What TreeSet is, usage, constructor, fields, other methods, and summary.

  144. String Comparisonhistorical

    Comparison of StringBuilder, StringBuffer, and String.

  145. Collections.synchronizedListhistorical

    1. What It Is: a thread-safe list. 2. Usage. 3. Source analysis: synchronizedList, SynchronizedList construction, mutex initialization, and synchronized method delegation.

  146. 5.24 TreeMaphistorical

    What TreeMap is, usage, and source analysis of constructors, put, get, containsKey, and remove.

  147. 5.25 Vectorhistorical

    What Vector is, usage, source analysis, synchronization, and thread-safety limitations of compound operations.

  148. 5.26 fail-fasthistorical

    fail-fast and fail-safe, Java iterator design, examples, implementation analysis, and summary.

  149. HashMap in JDK 7historical

    1. Questions: hand-written HashMap, why capacity is converted to a power of 2, resizing, hash collisions, head insertion, concurrent resize loops, null keys, and ConcurrentModificationException. 2. References.

  150. HashMap in JDK 8historical

    What HashMap is, usage, source analysis of construction, put, resize, treeification, get, containsKey, remove, containsValue, and differences from JDK 7.

  151. 6.1 Start with the Hardwarehistorical

    Hardware foundations needed to understand the JMM: von Neumann architecture, caches, coherence, pipelines, reordering, memory barriers, and memory consistency models.

  152. 6.2 2.Synchronizedhistorical

    1. What it is. An implementation of pessimistic locking in Java. Compared with volatile, it is a heavyweight lock and can guarantee atomicity, ordering, and visibility. 2. When to use it. 3. How to use it. 4. Principle analysis of synchronized blocks. 5. Principle analysis of synchronized methods.

  153. 6.3 3.volatilehistorical

    What volatile is, when it is more suitable than synchronized, an assembly experiment, and visibility/ordering analysis.

  154. 6.4 CAShistorical

    1. What it is. To understand CAS, first understand optimistic and pessimistic locking. 1.1. Optimistic vs. pessimistic locking. 1.2. CAS. 2. How to use it.

  155. 6.5 5.AQShistorical

    1. What it is. A queue synchronizer used to implement other concurrency utilities in JUC. 2. How to use it. 3. Principle analysis: queue structure, lock acquisition, enqueueing, parking, cancellation, interruption recovery, and lock release.

  156. 6.6 6.ReentrantLockhistorical

    What ReentrantLock is, comparison with synchronized, implementation principle, and references.

  157. 6.7 7.Lock Conditionhistorical

    1. What it is. Similar to Object.wait/notify with synchronized; Condition.await/signal work with Lock to implement conditional waiting and wake-up. 2. Usage. 3. Implementation principles: Condition queue, await, transfer to AQS queue, signalAll, and signal.

  158. 6.8 8.CyclicBarrierhistorical

    What CyclicBarrier is, usage with and without a barrier action, and source analysis based on Lock, Condition, generations, and await.

  159. 6.9 9.CountDownLatchhistorical

    What CountDownLatch is, how to use it, comparison with CyclicBarrier, and its AQS-based countDown/await implementation.

  160. 6.10 10.CopyOnWriteArrayListhistorical

    1. What it is. This list adopts the idea of separating reads and writes (weak consistency): reads can proceed concurrently without locking; writes require locking, copying the original data, modifying the copy, and then writing it back to the list. 2. How to use it. 3. Principles. 3.1. Constructor. The underlying implementation uses an Object array and accesses it through getArray/setArray.

  161. 6.11 11.CopyOnWriteArraySethistorical

    1. What it is. A copy-on-write set: ordered and without duplicates, implemented internally with CopyOnWriteArrayList. 2. How to use it. 3. Principle analysis. 3.1. Constructor. 3.1.1. The underlying implementation uses CopyOnWriteArrayList. 3.2. add method. 3.2.1. Delegates to CopyOnWriteArrayList.

  162. 6.12 ArrayBlockingQueuehistorical

    What ArrayBlockingQueue is, how to use it, and source analysis of its array, lock, conditions, put/take/offer/poll/add/remove/element/peek methods.

  163. 6.13 13.ThreadLocalhistorical

    What ThreadLocal is, how to use it, and source analysis of ThreadLocalMap, set/get/remove, open addressing, weak keys, and memory-leak concerns.

  164. 6.14 14.ThreadPoolhistorical

    1. What it is. Java's thread-pool framework separates task submission from task execution. 1.1. Why thread pools are needed: reuse threads, because creating/destroying threads is expensive and too many threads cause excessive CPU context switching. 1.2. Use cases: individual tasks should not run too long, and there are many tasks.

  165. 6.15 CompletableFuturehistorical

    1. What it is. Used for asynchronous programming. In Java, so-called asynchronous programming means putting blocking code into a separate thread for execution and notifying the main thread when a result is available. 2. Future vs CompletableFuture. 3. Usage. 4. Source-code analysis.

  166. 6.16 ConcurrentHashMap in JDK 1.7historical

    1. Constructor 2. put method 2.1. hash 2.2. ensureSegment 2.3. Segment.put 2.3.1. scanAndLockForPut 2.3.2. rehash 3. get 4. containsKey 5. remove 5.1. segmentForHash 5.2. Segment.remove

  167. 6.17 fork_joinhistorical

    What fork/join is, why it exists, usage, and work stealing.

  168. 6.18 Exchangerhistorical

    1. What it is. Used for exchanging data between two threads; data flows in both directions. 1.1. Exchanger vs. SynchronousQueue. 2. Usage. 3. Implementation analysis.

  169. 6.19 ReentrantReadWriteLockhistorical

    1. What ReentrantReadWriteLock is. 2. ReentrantReadWriteLock categories. 3. References.

  170. 6.20 Semaphorehistorical

    1. What it is. A rate-limiting utility class that allows only n threads to access a resource at the same time. 2. Implementation analysis. 2.1. UML.

  171. 6.21 Kernel-Level Threadhistorical

    1. What it is. 2. How to verify that Java threads are kernel-level threads. 2.1. Before running. 2.2. After running.

  172. 6.22 Unsafehistorical

    What Unsafe is, how it relates to manual memory access, and examples of reading and atomically updating fields by memory offset.

  173. 6.23 Revisiting the JMMhistorical

    After understanding the underlying computer architecture, revisit why the Java Memory Model is needed, what it defines, and happens-before.

  174. 6.24 Lock Optimizationhistorical

    1. JVM optimizations for locks: lock elimination, lock coarsening, biased locking, and adaptive locking. 2. Analysis of lock inflation. 3. Application-level optimization of lock usage. 4. Adjusting the number of spins.

  175. 6.25 Implementing a Simple AQS by Handhistorical

    Build a simple AQS-like lock by hand to better understand the real AQS source code: requirements, fields, blocking/waking, waiter queue, lock/unlock flow, fairness, final implementation, test, and flow.

  176. 6.26 Fair Lockhistorical

    A fair lock follows the first-come, first-served principle. Even after the lock has been released, a later-arriving thread cannot barge in; it must wait until nobody is ahead of it. 1. Usage. 2. Principle analysis.

  177. 6.27 BlockingQueuehistorical

    1. What it is. A thread-safe blocking queue. Characteristics: FIFO; blocking insertion when the queue is full and blocking removal when the queue is empty; bounded or unbounded capacity; thread safety. 2. Use cases. Producer-consumer. 3. How to use it. 4. Detailed comparison of BlockingQueue implementations.

  178. 6.28 Executorshistorical

    1. Usage 2. newCachedThreadPool 3. newScheduledThreadPool 4. newFixedThreadPool 5. newSingleThreadExecutor

  179. 6.29 ConcurrentHashMap in JDK 1.8historical

    1. What it is. A thread-safe HashMap implemented with synchronized + CAS + the HashMap structure (array + linked list + red-black tree). 2. How to use it. 3. Principle analysis: constructor, Node, put, initialization, insertion, resizing, get, remove, and containsKey.

  180. 6.30 Producer-Consumerhistorical

    1. Using BlockingQueue. 2. Using wait/notify. 3. Using Lock/Condition. Compared with wait/notify, two Conditions are used so producers and consumers are not woken together; each side wakes only the other side.

  181. 6.31 Nonfair ReadWriteLockhistorical

    1. What it is. A nonfair read-write lock may let a newly arriving thread compete without strictly following queue order. 2. How to use it. 3. Source-code analysis: constructor, read locking/unlocking, write locking/unlocking, and AQS integration.

  182. 6.32 Nonfair Semaphorehistorical

    1. What it is. Rate limiting using a nonfair strategy. 2. Usage. 3. Principle analysis: constructor, NonfairSync, acquire, shared acquisition through AQS, nonfair acquisition, release, and shared release.

  183. 6.33 Thread.sleephistorical

    1. When a thread wakes after sleep. 2. Thread.sleep vs. Object.wait. 3. References.

  184. 6.34 Nonfair Lockhistorical

    A nonfair lock allows any arriving thread to compete for the lock once it has been released, regardless of arrival order. 1. Usage. 2. Implementation principles.

  185. 6.35 LinkedBlockingQueuehistorical

    What LinkedBlockingQueue is, usage, and source analysis of its linked-list structure, separate put/take locks, conditions, and queue operations.

  186. 6.36 RejectedExecutionHandlerhistorical

    1. What is RejectedExecutionHandler? When corePoolSize is full, blockingQueue is full, and maxPoolSize is also full, how should a new task be handled? This is determined by RejectedExecutionHandler. 2. Types: CallerRunsPolicy, AbortPolicy, DiscardPolicy, DiscardOldestPolicy.

  187. 6.37 Deadlockhistorical

    Example and status inspection.

  188. 6.38 Fair ReadWriteLockhistorical

    1. What it is. A fair read-write lock follows queue order: if threads are already waiting ahead, the current thread should not barge in. 2. How to use it. 3. Source-code analysis: constructor, read locking/unlocking, write locking/unlocking, and AQS integration.

  189. 6.39 Fair Semaphorehistorical

    1. What it is. Rate limiting using a fair strategy. 2. Usage. 3. Principle analysis: constructor, FairSync, acquire, shared acquisition through AQS, fair acquisition, release, and shared release.

  190. 6.40 Thread Stateshistorical

    1. Thread state enum. 2. State transitions. 3. References.

  191. 6.41 PriorityBlockingQueuehistorical

    What PriorityBlockingQueue is, binary-heap basics, usage, and source analysis of growth, offer/put, take, and heap adjustment.

  192. 6.42 SynchronousQueuehistorical

    1. What it is. A blocking queue implemented internally with a singly linked structure that does not store elements. A writer must have a reader at the same time in order to proceed, and vice versa; otherwise the writer or reader remains blocked. 2. Usage. 3. Principles. 3.1. Constructor. 3.1.1. Transfer. 3.1.2. QNode. 3.2. put blocking. 3.2.1. Calls TransferQueue.

  193. 6.43 Atomichistorical

    1. What it is. Thread-safe atomic classes implemented with CAS. 2. Usage, using AtomicInteger as an example. 3. Principle analysis. 4. Problems with AtomicInteger: high CPU usage and the ABA problem, plus a version-number solution with AtomicStampedReference.

  194. JVM Learning Resourceshistorical

    Summary and answers for 24 JVM interview questions - Juejin.

  195. Java Production Issue Troubleshootinghistorical

    Troubleshooting memory saturation, CPU/thread problems, deadlocks, JVM tuning, and related references.

  196. Garbage Collection Conceptshistorical

    Reference counting, reachability analysis, GC Roots, concrete garbage collection algorithms, and references.

  197. 7.4 Class Lifecyclehistorical

    The class lifecycle: loading, linking, initialization, use, unloading, class loaders, parent delegation, and related questions.

  198. 7.5 Memory Regionshistorical

    JVM memory regions: shared heap and method area, per-thread stack and program counter, and PermGen/Metaspace.

  199. 7.6 Tuning Approachhistorical

    Goals of tuning, overall production steps, JMeter load-test tuning, and CMS tuning flow.

  200. Garbage Collection Algorithmshistorical

    Mark-sweep, mark-compact, copying, and generational collection.

  201. Class Initialization Orderhistorical

    When initialization is triggered, initialization rules, and examples for a single class and an inheritance hierarchy.

  202. 7.9 Object Allocation Ruleshistorical

    Historical rules and flow for object allocation in the JVM.

  203. 7.10 3. Garbage Collectorshistorical

    Generational collection and historical Serial, Parallel, CMS, and G1 collectors, including CMS/G1 details and comparison.

  204. Custom Class Loaderhistorical

    When a custom class loader is needed, how to implement one with findClass or loadClass, an example, and a reference.

  205. Escape Analysishistorical

    What escape analysis is, how to enable it, optimizations for non-escaping objects, lock elimination, scalar replacement, stack allocation, and references.

  206. 7.13 4. Selecting a Specific Garbage Collector with JVM Parametershistorical

    Matching young- and old-generation collectors, JVM parameters, and how to choose.

  207. 7.14 Object Creation Processhistorical

    Code, bytecode, explanation, and a proposed solution for object-creation instruction reordering.

  208. Garbage Collectionhistorical

    Garbage-collection concepts, when GC happens, what gets collected, what GC does, and references.

  209. 7.16 Object Layout in Memoryhistorical

    Object composition, object headers, instance data, padding, and a JOL experiment.

  210. 7.17 Referenceshistorical

    Strong, soft, weak, and phantom references, examples, and WeakHashMap.

  211. How Objects Are Locatedhistorical

    Oracle JDK and OpenJDK use direct pointers: fast access, but pointers need to be updated if GC moves surviving objects.

  212. 7.19 OOM Exampleshistorical

    Why OOM occurs and examples for heap, Metaspace, stack overflow, GC overhead, direct buffer memory, and native-thread exhaustion.

  213. 7.20 Performance Analysis Toolshistorical

    Built-in JDK tools such as jps, jinfo, jstack, jmap, jstat, and jhat, plus JMX, MAT, Java Mission Control, BTrace, flame graphs, YourKit, JProfiler, and GC log tools.

  214. 7.21 JVM Parameter Tuninghistorical

    Which JVM parameters to tune, JVM parameter types, how to inspect them, common options, examples, and a typical configuration.

  215. 7.22 GC Log Analysishistorical

    Parallel GC logs, tools, and references.

  216. OOPhistorical

    Whether creating a subclass object also creates a parent object, whether private fields are inherited, and references.

  217. 9. Reflectionhistorical

    What reflection is, how it is used, how it works, and reference links.

  218. 10. Sockethistorical

    Socket basics, TCP Socket/ServerSocket, UDP, and communication-protocol design.

  219. Servlethistorical

    Servlet lifecycle: init, service, destroy, garbage collection, and a reference.

  220. 11.2 Tuninghistorical

    JVM tuning, verifying JVM parameters, and Coyote Connector tuning.

  221. 11.3 Usagehistorical

    Create a project, create a Servlet, configure web.xml and Tomcat, run it, and deploy IDEA-generated files.

  222. 11.4 Connectorhistorical

    Overview and class diagrams for Tomcat Connector, Endpoint, Processor, and Adapter.

  223. Tomcat Startup Flowhistorical

    Startup entry classes, sequence diagram, and source tracing through Tomcat init and start from Bootstrap/Catalina to Server, Service, Connector, Endpoint, and Acceptor.

  224. Tomcat Request Processing: Source Viewhistorical

    Sequence diagram and source tracing from NioEndpoint accept/poll processing through SocketProcessor, Processor, CoyoteAdapter, valves, filters, and servlet invocation.

  225. Building Tomcat from Sourcehistorical

    1. Download and extract the source. 2. Convert it into a Maven project. 3. Configure the startup class and JVM arguments. 4. Configure JSP compilation. 5. References.

  226. 11.8 Containerhistorical

    Overview of the Tomcat container hierarchy, server.xml, and class diagram.

  227. 11.9 Configuration-File Levelhistorical

    Use http://localhost:8080/tomcat_test/hello as an example to locate the connector, engine/service, host/context, and wrapper.

  228. 11.10 LifeCyclehistorical

    Historical study note about LifeCycle.

  229. 11.11 Architecturehistorical

    What Tomcat is and why its HTTP server and Servlet container are designed as separate modules.

  230. Genericshistorical

    What generics are, their benefits and usage, why Java generics are sometimes described as fake, and references.

  231. Java 8 New Featureshistorical

    Java 8 features and a groupingBy example that converts a List into Map<String, List>.

  232. Comparehistorical

    1. What Compare is 2. Usage 3. References

  233. Estimating Thread Pool Sizehistorical

    1. Estimate the number of threads 1.1. Throughput = concurrency / response time 1.2. TPS estimation 1.3. I/O-intensive or CPU-intensive 1.4. Dark Magic 2. References

  234. Multithreaded Folder Size Statisticshistorical

    Start three threads to calculate separately; use the final thread to aggregate the result.