npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kyan-plugins/memory-monitor

v0.1.0

Published

App and OpenCode server memory in the OpenCode Desktop titlebar

Readme

@kyan-plugins/memory-monitor

App and OpenCode server memory in the OpenCode Desktop titlebar, with a per-process breakdown on click. Linux only.

The memory monitor dialog

What it shows

The titlebar shows a server icon at rest. On hover it reads 1.4G · 720M: app PSS first, then the OpenCode server, or off when the sidecar is not running. Click it for the totals, the sample time, cgroup current and peak usage, and a per-process breakdown sorted by PSS. The process list scrolls in a fixed-height region with a sticky header and a process count. The dialog samples fresh when it opens and has a Refresh action. If a sample fails, the hover text says so and a click retries; an open dialog shows the error with its own Retry action.

Install

opencode plugin add @kyan-plugins/memory-monitor

Requires OpenCode Desktop 2.2.0 or newer and Linux. Settings > Extensions > Plugins lists it after it loads. Other systems show it as not available.

Where the numbers come from

  • App tree: starts at the Electron main process (process.pid), walks /proc/<pid>/stat parent relationships, and sums Pss from /proc/<pid>/smaps_rollup for the main process and its descendants. Crashpad handlers and other reparented helpers are added when their --database or --user-data-dir matches the app, so losing their parent does not lose their memory.
  • OpenCode server: reads ~/.local/state/opencode/service.json and uses its pid only after checking that the process is alive, that its cmdline is the managed opencode-cli ... serve --service, and that its URL matches the sidecar endpoint the app reports. A stale or recycled pid, a plain development opencode serve, or an endpoint that cannot be matched reports the server as not running. The sidecar and its descendants are left out of the app tree, and the server total includes those descendants (language servers and tool children), so no pid counts in both totals.
  • Cgroup: reads the app's own cgroup from /proc/self/cgroup. On cgroup v2 it reads memory.current and memory.peak; on cgroup v1 it reads memory.usage_in_bytes and memory.max_usage_in_bytes. Missing files or an unreadable cgroup show as unavailable rather than failing the sample.
  • PSS: proportional set size counts a shared page once across the processes that map it. It is lower than RSS, which counts that page in every process.

The titlebar samples every 45 seconds, and only while its window is visible and focused. It refreshes on focus and stops its timer when the window blurs or hides. The dialog samples once on open and then only when you press Refresh.

Processes can exit while a sample runs. Unreadable or vanished entries are skipped, so one exit does not fail the whole sample.

Reads are local /proc and cgroup files, plus ~/.local/state/opencode/service.json to locate the managed server. Nothing leaves the machine and no data is stored.

Compatibility

The GUI plugin API is experimental, and this package is built against @opencode/plugin 2.2.0. A future desktop release can change that API, so check the release notes before assuming a newer app works.

Development

bun install
bun run dev     # rebuilds dist/gui-experimental.cjs on change

To test a local checkout, point the global config at it instead of the package name:

// ~/.config/opencode/opencode.jsonc
{
  "plugins": ["/path/to/opencode-plugins/packages/memory-monitor"]
}

The app reloads the bundle in every window after each rebuild.

License

MIT