Memory Analysis logo

Memory Analysis

Community
LeoKemp223
memory-analysis

当需要解析 .map 文件或 ELF 获取固件内存使用报告、符号大小排名或版本对比时使用。

Overview

PublisherLeoKemp223
Repositoryembed-ai-tool
Skill namememory-analysis
Stars
995
Forks
168
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by LeoKemp223 on GitHub. Read the source before you install it.

Installation

Install the Memory Analysis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/LeoKemp223/embed-ai-tool/tree/master/skills/memory-analysis
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LeoKemp223/embed-ai-tool.git /tmp/embed-ai-tool
mkdir -p .claude/skills
cp -r /tmp/embed-ai-tool/skills/memory-analysis .claude/skills/memory-analysis
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Memory Analysis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Memory Analysis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Memory Analysis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

固件内存分析

适用场景

  • 构建完成后需要了解固件的 Flash/RAM 使用情况。
  • 需要找出占用空间最大的函数或变量。
  • 需要对比两次构建的内存变化,追踪代码膨胀。
  • 需要确认固件是否即将超出芯片内存限制。
  • 需要解析链接脚本获取芯片 Flash/RAM 总容量。

必要输入

  • .map 文件路径(GCC/ARM 链接器生成),或 ELF 文件路径。
  • 可选的链接脚本路径(用于计算使用率百分比)。
  • 可选的告警阈值和 Top-N 符号数量。

自动探测

  • --scan 模式自动搜索构建目录中的 .map 和 ELF 文件。
  • 解析 .map 文件中的 Memory Configuration 块获取 FLASH/RAM 总容量。
  • 若提供链接脚本,从 MEMORY {} 块解析容量信息。
  • 自动检测 arm-none-eabi-size 和 arm-none-eabi-readelf 可用性。

执行步骤

  1. 先阅读 references/usage.md,确认本次是环境探测、构建目录扫描,还是执行分析。
  2. 若不确定工具是否可用,先运行 scripts/memory_analyzer.py 的 --detect 模式确认。
  3. 使用 --scan <build_dir> 自动查找可分析的文件。
  4. 使用 --map-file 或 --elf 执行内存分析。
  5. 可选使用 --linker-script 获取总容量并计算使用率。
  6. 使用 --top <N> 查看占用最大的符号。
  7. 使用 --compare 对比两个 .map 文件的差异。

失败分流

  • 当 arm-none-eabi-size 或 arm-none-eabi-readelf 不可用且需要 ELF 分析时,返回 environment-missing。
  • 当指定的 .map 或 ELF 文件不存在时,返回 artifact-missing。
  • 当 .map 文件格式无法识别或解析失败时,返回 project-config-error。
  • 当内存使用率超过告警阈值时,在成功结果中附带告警信息。

平台说明

  • .map 文件解析使用纯正则,无需外部工具,全平台可用。
  • ELF 分析需要 arm-none-eabi-size,通常随交叉编译工具链安装。
  • 链接脚本解析使用纯正则,支持 GCC LD 格式。

输出约定

  • 输出各 section(.text, .rodata, .data, .bss)的大小和地址。
  • 输出 Flash 使用量(.text + .rodata + .data)和 RAM 使用量(.data + .bss)。
  • 若有总容量信息,输出使用率百分比和告警状态。
  • 输出按大小排序的 Top-N 符号列表。
  • 对比模式输出各 section 和符号的增减变化。

交接关系

  • 当内存即将溢出需要优化时,建议用户审查 Top-N 大符号。
  • 当需要定位具体函数在代码中的位置时,可配合 IDE 或 grep 使用。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Memory Analysis AI skill do?

当需要解析 .map 文件或 ELF 获取固件内存使用报告、符号大小排名或版本对比时使用。

Why use Memory Analysis on TypingMind?

Because you install it once and use it with any model. Memory Analysis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Memory Analysis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/LeoKemp223/embed-ai-tool/tree/master/skills/memory-analysis. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Memory Analysis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Memory Analysis?

As many as you like. As long as a model supports skills, you can use Memory Analysis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Memory Analysis AI skill free?

It is published on GitHub by LeoKemp223. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇