Skip to content
Agentmart
Submit a tool

dart-memory

Use when troubleshooting memory leaks, optimizing garbage collection overhead, or disposing streams and listeners in Dart.

Skill by dhruvanbhalara

IndexedMIT★ 30
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/dhruvanbhalara-dart-memory

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when troubleshooting memory leaks, optimizing garbage collection overhead, or disposing streams and listeners in Dart.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/dart-memory

What's inside

Skill name
dart-memory
Description
Use when troubleshooting memory leaks, optimizing garbage collection overhead, or disposing streams and listeners in Dart.
License
MIT
Metadata
category: optimization · languages: dart · platforms: cross-platform, mobile
Instructions
23 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Memory Management

Mobile devices have limited RAM. Efficient memory management is critical to prevent crashes and ensure a smooth user experience.

## Resource Lifecycle
- **Explicit Disposal**: Always close `StreamController`, `Timer`, `FocusNode`, and `ChangeNotifier` in the `dispose()` method.
- **Late Initialization**: Use `late` to delay object creation until it's actually needed, reducing initial memory footprint.

## Garbage Collection (GC) Pressure
- **Generational GC**: Dart's GC is optimized for short-lived objects. However, creating thousands of objects in a single frame can still cause jank.
- **Object Re-use**: Avoid creating new objects in `build()` or high-frequency loops. Reuse data structures where possible.
- **Large Collections**: Clearing a large list (`list.clear()`) is better than re-assigning it to a new list if the list itself is long-lived.

## Mobile Specifics
- **Isolates**: Use `Isolate.run()` for heavy computations (JSON parsing > 1MB, image processing). This keeps the main thread free and prevents UI freezes.
- **Image Memory**: Use `cacheWidth` and `cacheHeight` in `Image.network` or `Image.asset` to avoid loading high-resolution images into memory at full size.
- **Memory Leaks**: Use the DevTools Memory View to identify "leaking" objects that stay in the heap after their context (like a screen) is closed.

## Large Data Handling
- **Pagination**: Never load entire datasets into memory. Use server-side or local database pagination (Isar, SQLite).
- **Streaming**: For large files or real-time data, use `Stream` to process data in chunks rather than buffering the entire content in memory.

From dhruvanbhalara/skills, MIT.

More from dhruvanbhalara/skills

Signals

Stars
30
Forks
4
Open issues
0
Last commit (this folder)
Aug 29, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from dhruvanbhalara

Cite this page

dart-memory skill. Agent Mart. https://agentmart.dev/skills/dhruvanbhalara-dart-memory (last updated 2026-10-24)