xiaogenban1993's Technical Blog

website·Indexed 29 days ago

https://xiaogenban1993.github.io

A collection of technical guides and notes covering a wide range of topics including Next.js 14, Java ASM, MySQL internals, Rust, Go, and frontend development with React, Tailwind CSS, and WebAssembly. The site also features explorations of TUI libraries like Bubble Tea and Ratatui, JVM memory models for JDK 8, and Linux ELF program loading.

Tokens
188.7K
Snippets
766
Records
1.2K
Agent score
74%

What's inside xiaogenban1993

  1. Overview of JVM Young Generation Garbage Collectors

    The Young Generation uses collectors primarily based on the copying algorithm. Available options include:

    • Serial: Single-threaded, Stop-The-World (STW). Simple and practical; often paired with Serial Old.
    • ParNew: Multi-threaded version of Serial, STW. Often paired with CMS.
    • Parallel Scavenge: Multi-threaded, STW. Focused on maximizing throughput; often paired with Parallel Old.
  2. Overview of JVM Old Generation Garbage Collectors

    The Old Generation uses collectors primarily based on the mark-compact or mark-sweep algorithms:

    • Serial Old: Single-threaded, mark-compact, STW. Simple and practical.
    • Parallel Old: Multi-threaded, mark-compact, STW. Used in throughput-focused scenarios, typically paired with Parallel Scavenge.
    • CMS (Concurrent Mark Sweep): Designed to minimize STW time. Uses a mark-sweep algorithm which can lead to memory fragmentation. It is commonly paired with ParNew.
  3. Overview of Service Worker capabilities and constraints

    A Service Worker is a built-in browser feature that runs as a separate background thread. Its primary purposes are resource caching and push notifications. Because it operates independently of specific pages and is shared across multiple tabs within its scope, it cannot access or manipulate the DOM.
  4. Overview of Tailwind CSS

    Tailwind CSS is a utility-first CSS framework that provides low-level utility classes to build custom designs without leaving your HTML. Instead of predefined components (like Bootstrap's .btn), it provides atomic classes that map directly to CSS properties. For example, flex-1 maps to flex: 1 1 0% and text-xs maps to font-size: 0.75rem; line-height: 1rem;. It uses PostCSS and Autoprefixer to ensure cross-browser compatibility and removes unused styles from the final CSS bundle to optimize file size.
  5. Overview of JDK 8 JVM Memory Model

    The JDK 8 JVM memory model is divided into five main areas:

    1. Heap: Stores all objects created with the new keyword. It is the primary area managed by Garbage Collection (GC).
    2. Stack: A thread-private area used to store local variables (8 primitive types), object references, and return addresses. It uses 'stack frames' for function execution and is automatically released when a method returns.
    3. Method Area (Metaspace): In JDK 8, the 'Permanent Generation' (PermGen) from JDK 7 was replaced by Metaspace. It stores class metadata (e.g., class loaders). Metaspace size is not limited by JVM parameters but uses the native memory of the computer.
    4. Program Counter Register: Thread-private; generally not managed by developers.
    5. Native Method Stack: Thread-private; used for native method execution.
  6. Overview of Baidu Cloud IoT Platform Architecture

    Baidu Cloud IoT is an industrial IoT management platform that handles the entire data lifecycle from device/gateway to cloud storage and visualization. The standard data flow is: Gateway $\rightarrow$ MQTT Server $\rightarrow$ Parsing $\rightarrow$ Rule Engine $\rightarrow$ Database $\rightarrow$ Visualization.
  7. Overview of etcd distributed storage

    etcd is a distributed key-value store designed for reliable and fast storage and retrieval of critical data. It is primarily used for storing metadata in distributed systems and provides mechanisms for distributed coordination, such as distributed locks, leader election, and write barriers to ensure high availability and persistence.
  8. Overview of Dynamic Programming (DP) patterns

    Dynamic Programming (DP) is used to find the number of ways or an optimal value for a problem by breaking it down into subproblems. It is closely related to Depth First Search (DFS), but while DFS explores all paths, DP typically focuses on the count or optimal result. DP is generally categorized into:

    • 1D DP: Uses a one-dimensional array where the state dp[i] depends on previous states like dp[i-x]. These can often be optimized from O(n) space to O(1) if only a few previous values are needed.
    • 2D DP: Requires defining a state dp[i][j] (often representing a matrix or string prefixes) and finding the relationship between the current cell and other elements in the matrix.
  9. Overview of JavaScript application domains

    JavaScript is a versatile language applicable across multiple domains:

    • Web Frontend: Traditional DOM manipulation and server interaction.
    • Backend/Server-side: Using Node.js for server-side logic and scripts.
    • Game Development: Supported by engines like Cocos and Unity.
    • Mobile: Via React Native or hybrid wrappers.
    • Desktop: Via frameworks like Electron.
  10. Lua Language Overview and Use Case

    Lua is a lightweight script language written in C. It is primarily designed for flow control and glue logic rather than heavy-duty implementation. It is ideal for simple numeric/string processing and conditional logic, while performance-critical tasks (like IO, complex data storage, or multi-threading) should be handled by C/C++ functions and called from Lua.