高级java每日一道面试题-2027年04月12日-实战篇[Docker]-如何实现容器的核心转储 (Core Dump) 分析? - 6261682243, 59

📅 2026-12-01 👤 拼多多助力营销技巧 📂 拼多多助力2027 👁️ 108 次阅读

容器核心转储(Core Dump)是诊断进程崩溃、内存错误或 JVM 自身故障的最后手段。在 Docker 环境中,Core Dump 的生成、收集和分析需要协调宿主机内核、容器配置和调试工具,尤其对 Java 应用,还需区分 JVM 崩溃、Native 内存泄漏和 OOM 等场景。以下从原理、配置、收集、分析及 Java 特殊点系统阐述。

一、核心转储在容器中的基本原理与挑战

Linux 内核在进程收到致命信号(如 SIGSEGV、SIGABRT)时,会将该进程的内存映像写入文件,其路径和格式由 /proc/sys/kernel/core_pattern 决定。容器共享宿主机内核,因此核心转储行为受宿主机全局参数控制。

主要挑战:

路径隔离:若 core_pattern 设置为相对路径,core 文件会落在进程的当前工作目录,可能位于容器可写层,容器删除后即丢失。大小限制:容器默认 ulimit 可能限制 core 文件大小为 0,需显式放开。权限与命名空间:容器内进程的 core dump 可能因用户命名空间映射而无法在宿主机直接读取。Java 特殊性:JVM 崩溃产生的 core 文件包含整个 JVM 堆和本地内存,体积巨大,且需结合 JVM 调试符号分析。

#mermaid-svg-wRjejmueG4v7tH1o{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-wRjejmueG4v7tH1o .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-wRjejmueG4v7tH1o .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-wRjejmueG4v7tH1o .error-icon{fill:#552222;}#mermaid-svg-wRjejmueG4v7tH1o .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-wRjejmueG4v7tH1o .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-wRjejmueG4v7tH1o .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-wRjejmueG4v7tH1o .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-wRjejmueG4v7tH1o .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-wRjejmueG4v7tH1o .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-wRjejmueG4v7tH1o .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-wRjejmueG4v7tH1o .marker{fill:#333333;stroke:#333333;}#mermaid-svg-wRjejmueG4v7tH1o .marker.cross{stroke:#333333;}#mermaid-svg-wRjejmueG4v7tH1o svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-wRjejmueG4v7tH1o p{margin:0;}#mermaid-svg-wRjejmueG4v7tH1o .edge{stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .section--1 rect,#mermaid-svg-wRjejmueG4v7tH1o .section--1 path,#mermaid-svg-wRjejmueG4v7tH1o .section--1 circle,#mermaid-svg-wRjejmueG4v7tH1o .section--1 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section--1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section--1 text{fill:#ffffff;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon--1{font-size:40px;color:#ffffff;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge--1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth--1{stroke-width:17;}#mermaid-svg-wRjejmueG4v7tH1o .section--1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-0 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-0 path,#mermaid-svg-wRjejmueG4v7tH1o .section-0 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-0 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-wRjejmueG4v7tH1o .section-0 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-0{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-0{stroke-width:14;}#mermaid-svg-wRjejmueG4v7tH1o .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-1 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-1 path,#mermaid-svg-wRjejmueG4v7tH1o .section-1 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-1 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-1 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-1{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-1{stroke-width:11;}#mermaid-svg-wRjejmueG4v7tH1o .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-2 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-2 path,#mermaid-svg-wRjejmueG4v7tH1o .section-2 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-2 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-2 text{fill:#ffffff;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-2{stroke-width:8;}#mermaid-svg-wRjejmueG4v7tH1o .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-3 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-3 path,#mermaid-svg-wRjejmueG4v7tH1o .section-3 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-3 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-3 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-3{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-3{stroke-width:5;}#mermaid-svg-wRjejmueG4v7tH1o .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-4 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-4 path,#mermaid-svg-wRjejmueG4v7tH1o .section-4 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-4 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-4 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-4{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-4{stroke-width:2;}#mermaid-svg-wRjejmueG4v7tH1o .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-5 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-5 path,#mermaid-svg-wRjejmueG4v7tH1o .section-5 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-5 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-5 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-5{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-5{stroke-width:-1;}#mermaid-svg-wRjejmueG4v7tH1o .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-6 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-6 path,#mermaid-svg-wRjejmueG4v7tH1o .section-6 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-6 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-6 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-6{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-6{stroke-width:-4;}#mermaid-svg-wRjejmueG4v7tH1o .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-7 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-7 path,#mermaid-svg-wRjejmueG4v7tH1o .section-7 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-7 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-7 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-7{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-7{stroke-width:-7;}#mermaid-svg-wRjejmueG4v7tH1o .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-8 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-8 path,#mermaid-svg-wRjejmueG4v7tH1o .section-8 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-8 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-8 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-8{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-8{stroke-width:-10;}#mermaid-svg-wRjejmueG4v7tH1o .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-9 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-9 path,#mermaid-svg-wRjejmueG4v7tH1o .section-9 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-9 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-9 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-9{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-9{stroke-width:-13;}#mermaid-svg-wRjejmueG4v7tH1o .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-10 rect,#mermaid-svg-wRjejmueG4v7tH1o .section-10 path,#mermaid-svg-wRjejmueG4v7tH1o .section-10 circle,#mermaid-svg-wRjejmueG4v7tH1o .section-10 polygon,#mermaid-svg-wRjejmueG4v7tH1o .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-10 text{fill:black;}#mermaid-svg-wRjejmueG4v7tH1o .node-icon-10{font-size:40px;color:black;}#mermaid-svg-wRjejmueG4v7tH1o .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .edge-depth-10{stroke-width:-16;}#mermaid-svg-wRjejmueG4v7tH1o .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-wRjejmueG4v7tH1o .disabled,#mermaid-svg-wRjejmueG4v7tH1o .disabled circle,#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:lightgray;}#mermaid-svg-wRjejmueG4v7tH1o .disabled text{fill:#efefef;}#mermaid-svg-wRjejmueG4v7tH1o .section-root rect,#mermaid-svg-wRjejmueG4v7tH1o .section-root path,#mermaid-svg-wRjejmueG4v7tH1o .section-root circle,#mermaid-svg-wRjejmueG4v7tH1o .section-root polygon{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-wRjejmueG4v7tH1o .section-root text{fill:#ffffff;}#mermaid-svg-wRjejmueG4v7tH1o .section-root span{color:#ffffff;}#mermaid-svg-wRjejmueG4v7tH1o .section-2 span{color:#ffffff;}#mermaid-svg-wRjejmueG4v7tH1o .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-wRjejmueG4v7tH1o .edge{fill:none;}#mermaid-svg-wRjejmueG4v7tH1o .mindmap-node-label{dy:1em;alignment-baseline:middle;text-anchor:middle;dominant-baseline:middle;text-align:center;}#mermaid-svg-wRjejmueG4v7tH1o :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}容器Core Dump触发场景段错误 SIGSEGV异常终止 SIGABRTJVM 崩溃可配置挑战宿主机 core_pattern 全局容器可写层易丢失ulimit 限制用户命名空间映射JVM 核心 dump 体积大

二、配置容器生成 Core Dump

要让容器进程产生 core dump,需同时调整宿主机内核参数与容器启动配置。

配置项作用域理论说明推荐设置core_pattern宿主机定义 core 文件保存路径和命名规则,支持管道。使用管道转发到专用收集器,避免容器内部写入。例如 `ulimit -c容器限制 core 文件最大大小,0 表示不生成。启动容器时 --ulimit core=-1:unlimited 或 --ulimit core=unlimited。apport / systemd-coredump宿主机系统级 core dump 处理服务,可接管 core_pattern 并存储压缩 core 文件。配合 systemd-coredump 使用 `core_pattern=Docker 内核参数容器通过 --sysctl 可以覆盖容器可见的 kernel.core_pattern(仅当宿主机允许 user namespace 修改时),但最终仍受宿主机实际内核处理。不推荐在容器内修改,应统一宿主机策略。三、收集 Core Dump 的三种主流模式

根据 core 文件是否保留在容器内、如何转发到分析环境,可分为三种模式。 拼多多帮助力入口

#mermaid-svg-xqgQBWFQSkhGRiSj{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-xqgQBWFQSkhGRiSj .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-xqgQBWFQSkhGRiSj .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-xqgQBWFQSkhGRiSj .error-icon{fill:#552222;}#mermaid-svg-xqgQBWFQSkhGRiSj .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-xqgQBWFQSkhGRiSj .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-xqgQBWFQSkhGRiSj .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-xqgQBWFQSkhGRiSj .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-xqgQBWFQSkhGRiSj .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-xqgQBWFQSkhGRiSj .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-xqgQBWFQSkhGRiSj .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-xqgQBWFQSkhGRiSj .marker{fill:#333333;stroke:#333333;}#mermaid-svg-xqgQBWFQSkhGRiSj .marker.cross{stroke:#333333;}#mermaid-svg-xqgQBWFQSkhGRiSj svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-xqgQBWFQSkhGRiSj p{margin:0;}#mermaid-svg-xqgQBWFQSkhGRiSj .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-xqgQBWFQSkhGRiSj .cluster-label text{fill:#333;}#mermaid-svg-xqgQBWFQSkhGRiSj .cluster-label span{color:#333;}#mermaid-svg-xqgQBWFQSkhGRiSj .cluster-label span p{background-color:transparent;}#mermaid-svg-xqgQBWFQSkhGRiSj .label text,#mermaid-svg-xqgQBWFQSkhGRiSj span{fill:#333;color:#333;}#mermaid-svg-xqgQBWFQSkhGRiSj .node rect,#mermaid-svg-xqgQBWFQSkhGRiSj .node circle,#mermaid-svg-xqgQBWFQSkhGRiSj .node ellipse,#mermaid-svg-xqgQBWFQSkhGRiSj .node polygon,#mermaid-svg-xqgQBWFQSkhGRiSj .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-xqgQBWFQSkhGRiSj .rough-node .label text,#mermaid-svg-xqgQBWFQSkhGRiSj .node .label text,#mermaid-svg-xqgQBWFQSkhGRiSj .image-shape .label,#mermaid-svg-xqgQBWFQSkhGRiSj .icon-shape .label{text-anchor:middle;}#mermaid-svg-xqgQBWFQSkhGRiSj .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-xqgQBWFQSkhGRiSj .rough-node .label,#mermaid-svg-xqgQBWFQSkhGRiSj .node .label,#mermaid-svg-xqgQBWFQSkhGRiSj .image-shape .label,#mermaid-svg-xqgQBWFQSkhGRiSj .icon-shape .label{text-align:center;}#mermaid-svg-xqgQBWFQSkhGRiSj .node.clickable{cursor:pointer;}#mermaid-svg-xqgQBWFQSkhGRiSj .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-xqgQBWFQSkhGRiSj .arrowheadPath{fill:#333333;}#mermaid-svg-xqgQBWFQSkhGRiSj .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-xqgQBWFQSkhGRiSj .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-xqgQBWFQSkhGRiSj .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-xqgQBWFQSkhGRiSj .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-xqgQBWFQSkhGRiSj .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-xqgQBWFQSkhGRiSj .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-xqgQBWFQSkhGRiSj .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-xqgQBWFQSkhGRiSj .cluster text{fill:#333;}#mermaid-svg-xqgQBWFQSkhGRiSj .cluster span{color:#333;}#mermaid-svg-xqgQBWFQSkhGRiSj div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-xqgQBWFQSkhGRiSj .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-xqgQBWFQSkhGRiSj rect.text{fill:none;stroke-width:0;}#mermaid-svg-xqgQBWFQSkhGRiSj .icon-shape,#mermaid-svg-xqgQBWFQSkhGRiSj .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-xqgQBWFQSkhGRiSj .icon-shape p,#mermaid-svg-xqgQBWFQSkhGRiSj .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-xqgQBWFQSkhGRiSj .icon-shape .label rect,#mermaid-svg-xqgQBWFQSkhGRiSj .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-xqgQBWFQSkhGRiSj .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-xqgQBWFQSkhGRiSj .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-xqgQBWFQSkhGRiSj :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}模式三:容器内安装工具调用生成 core手动拷贝容器gcore / gdb容器内路径Analysis3模式二:管道转发内核生成容器core_pattern 管道宿主机 core 收集器systemd-coredump / 自定义集中存储 / NFS模式一:挂载卷收集core 写入容器共享卷 /cores分析环境挂载同一卷

对比:

收集方式优点缺点适用场景宿主机管道不依赖容器存储,全局统一,可压缩,自动处理需要宿主机配置,容器内部不可见生产环境集群挂载卷实现简单,容器直接写入共享目录多容器 core 混存,需手动清理,卷性能问题开发测试环境容器内手动生成灵活,可指定路径侵入容器,需安装调试工具,可能影响运行临时调试推荐生产方案:宿主机启用 systemd-coredump,设置 core_pattern 为管道,容器仅需 --ulimit core=-1,所有 core dump 自动被宿主机统一管理,并可通过 coredumpctl 查看。

四、分析 Core Dump 的方法

分析时需要可执行文件、动态库和调试符号与生成环境一致,通常需在相同容器镜像或调试容器中进行。

GDB 基础分析:使用 gdb <可执行文件> 进入,执行 bt 查看崩溃时的调用栈,info registers 查看寄存器,thread apply all bt 查看所有线程栈。多线程与死锁:观察线程栈是否在锁等待,结合 info threads 定位问题线程。内存分析:对于 native 内存泄漏或堆损坏,可使用 valgrind 或 AddressSanitizer,但它们是运行时工具,不能直接分析 core dump。可检查 pmap 映射。Java Core Dump 特殊性:

若 JVM 崩溃(hs_err_pid.log 通常已记录),产生的 core 文件包含 JVM 本身和 Java 堆。可使用 jhsdb jmap --core--binaryheap dump.hprof 从 core dump 中提取 Java 堆转储。分析 native 调用栈需加载 JVM 调试符号(如 libjvm.debuginfo),并查看 JIT 编译的代码区域。对于 OOM 触发的 core dump(需配置 -XX:+CrashOnOutOfMemoryError),更高效的方法是直接生成 Heap dump,而非依赖 core dump。

五、Java 容器的特殊考量与最佳实践

JVM 参数:添加 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/dumps,并挂载 /dumps 卷,可单独收集 heap dump,不依赖 core dump。Core dump 生成条件:使用 -XX:+CrashOnOutOfMemoryError 或 kill -SIGABRT 可主动生成 core。体积控制:容器内存限制可能使 core 文件超大,需确保存储卷有足够空间,并配合压缩。符号与镜像:分析时必须使用与崩溃容器完全相同的镜像版本,或保留 debuginfo 仓库。排查流程:

开发者核心存储systemd-coredump宿主机内核容器进程开发者核心存储systemd-coredump宿主机内核容器进程#mermaid-svg-Mo1x9gr7Ca4eMMYX{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-Mo1x9gr7Ca4eMMYX .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .error-icon{fill:#552222;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .marker.cross{stroke:#333333;}#mermaid-svg-Mo1x9gr7Ca4eMMYX svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Mo1x9gr7Ca4eMMYX p{margin:0;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-Mo1x9gr7Ca4eMMYX text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-Mo1x9gr7Ca4eMMYX .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-Mo1x9gr7Ca4eMMYX #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .sequenceNumber{fill:white;}#mermaid-svg-Mo1x9gr7Ca4eMMYX #sequencenumber{fill:#333;}#mermaid-svg-Mo1x9gr7Ca4eMMYX #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .messageText{fill:#333;stroke:none;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .labelText,#mermaid-svg-Mo1x9gr7Ca4eMMYX .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .loopText,#mermaid-svg-Mo1x9gr7Ca4eMMYX .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-Mo1x9gr7Ca4eMMYX .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .noteText,#mermaid-svg-Mo1x9gr7Ca4eMMYX .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .actorPopupMenu{position:absolute;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-Mo1x9gr7Ca4eMMYX .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-Mo1x9gr7Ca4eMMYX .actor-man circle,#mermaid-svg-Mo1x9gr7Ca4eMMYX line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-Mo1x9gr7Ca4eMMYX :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}发生致命信号 (SIGSEGV)core_pattern 管道传递 core dump压缩存储 core 文件使用相同镜像启动调试容器挂载 core 文件与符号目录gdb / hsdb 分析调用栈和内存定位根因

六、思维导图总结

#mermaid-svg-KMLKFjFdRcKPZYs2{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-KMLKFjFdRcKPZYs2 .error-icon{fill:#552222;}#mermaid-svg-KMLKFjFdRcKPZYs2 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-KMLKFjFdRcKPZYs2 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-KMLKFjFdRcKPZYs2 .marker.cross{stroke:#333333;}#mermaid-svg-KMLKFjFdRcKPZYs2 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-KMLKFjFdRcKPZYs2 p{margin:0;}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge{stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section--1 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section--1 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section--1 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section--1 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section--1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section--1 text{fill:#ffffff;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon--1{font-size:40px;color:#ffffff;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge--1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth--1{stroke-width:17;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section--1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-0 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-0 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-0 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-0 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-0 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-0{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-0{stroke-width:14;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-1 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-1 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-1 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-1 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-1 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-1{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-1{stroke-width:11;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-2 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-2 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-2 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-2 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-2 text{fill:#ffffff;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-2{stroke-width:8;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-3 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-3 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-3 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-3 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-3 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-3{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-3{stroke-width:5;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-4 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-4 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-4 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-4 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-4 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-4{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-4{stroke-width:2;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-5 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-5 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-5 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-5 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-5 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-5{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-5{stroke-width:-1;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-6 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-6 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-6 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-6 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-6 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-6{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-6{stroke-width:-4;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-7 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-7 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-7 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-7 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-7 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-7{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-7{stroke-width:-7;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-8 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-8 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-8 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-8 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-8 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-8{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-8{stroke-width:-10;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-9 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-9 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-9 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-9 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-9 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-9{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-9{stroke-width:-13;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-10 rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-10 path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-10 circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-10 polygon,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-10 text{fill:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .node-icon-10{font-size:40px;color:black;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge-depth-10{stroke-width:-16;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:lightgray;}#mermaid-svg-KMLKFjFdRcKPZYs2 .disabled text{fill:#efefef;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-root rect,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-root path,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-root circle,#mermaid-svg-KMLKFjFdRcKPZYs2 .section-root polygon{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-root text{fill:#ffffff;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-root span{color:#ffffff;}#mermaid-svg-KMLKFjFdRcKPZYs2 .section-2 span{color:#ffffff;}#mermaid-svg-KMLKFjFdRcKPZYs2 .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-KMLKFjFdRcKPZYs2 .edge{fill:none;}#mermaid-svg-KMLKFjFdRcKPZYs2 .mindmap-node-label{dy:1em;alignment-baseline:middle;text-anchor:middle;dominant-baseline:middle;text-align:center;}#mermaid-svg-KMLKFjFdRcKPZYs2 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}容器Core Dump分析配置--ulimit core=-1宿主机 core_patternsystemd-coredump收集挂载卷写入宿主机管道转发容器内手动生成分析GDB 调用栈多线程死锁从 core 提取 Java heap dumpJVM hs_err 日志辅助Java 特殊HeapDumpOnOutOfMemoryErrorCrashOnOutOfMemoryError调试符号匹配容器镜像一致性

总结:实现容器核心转储分析需要打通宿主机内核配置、容器资源限制和调试工具链。生产环境推荐通过宿主机管道集中收集,容器仅放行 ulimit;分析时确保使用一致的镜像和调试符号,并针对 Java 应用优先依赖 heap dump 和 hs_err 日志。在面试中,能完整阐述这套端到端的配置与分析流程,是高级工程师容器化故障诊断能力的直接体现。

标签: 拼多多助力网站平台 赚钱项目 拼多多助力网 首码项目 手赚APP
拼多多助力营销技巧