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

rytena-agent

v1.0.1

Published

Production memory leak detection for Node.js — detects leaks, finds the exact file and line, and generates AI-powered fixes.

Downloads

284

Readme

rytena-agent

Production memory leak detection for Node.js.

Detects leaks in real time. Finds the exact file and line. Generates AI-powered fixes.

npm version license node

Website · Documentation · Dashboard


What is Rytena

Rytena watches your Node.js processes in production. When memory starts growing where it shouldn't, Rytena catches it — identifies the exact code responsible, explains why in plain English, and suggests a fix you can ship.

No graphs to interpret. No stack traces to dig through. Just answers.


Install

npm install rytena-agent

Zero native dependencies. Works on any Node.js 16+.


Quick start

Add three lines to your app's entry file — before any other imports.

const { Rytena } = require('rytena-agent')

Rytena.init({
  apiKey: process.env.RYTENA_API_KEY
})

That's the entire integration. The agent starts monitoring immediately.

Get your API key at rytena.vercel.app/dashboard.


What you get

  • Real-time detection — heap sampled every 30 seconds
  • Root cause — exact file, function, and line responsible for the leak
  • Code context — 10 lines around the leak location, captured automatically
  • AI analysis — plain-English explanation of why the code leaks memory
  • Fix suggestions — corrected code snippet you can review and merge
  • Email alerts — get notified before your process runs out of memory
  • Zero dependencies — no native compilation, no C++ bindings, no fragile toolchains

How it works

Rytena uses Node's built-in inspector module to sample V8's heap. When it detects sustained memory growth (15%+ across the rolling window), it runs a 30-second deep scan to identify which functions are allocating the most memory.

The agent extracts source code around the leak location and sends it to Rytena's backend, which runs it through an LLM to generate a specific root cause analysis and fix.

You never leave your editor. You never dig through stack traces. You just get a leak report with a fix.


Configuration

Rytena.init({
  apiKey:   'ryt_xxxx.yyyy',          // required
  name:     'production-api',          // optional — display name
  endpoint: 'https://api.rytena.dev',  // optional — for self-hosted
  interval: 30,                        // optional — seconds between snapshots
  debug:    false                      // optional — verbose logs
})

Environment variables

All options can be set via environment variables:

RYTENA_API_KEY=ryt_xxxx.yyyy
RYTENA_APP_NAME=production-api
RYTENA_ENDPOINT=https://api.rytena.dev
RYTENA_INTERVAL=30
RYTENA_DEBUG=false

Options passed to init() take precedence over environment variables.


API

Rytena.init(options)

Starts the agent. Registers with the Rytena backend, begins collecting snapshots on the configured interval, and runs deep scans when leaks are detected.

Rytena.stop()

Gracefully stops the agent. Clears the monitoring interval and removes event listeners.

Rytena.status()

Returns the current agent state.

Rytena.status()
// {
//   running:   true,
//   processId: 42,
//   runtimeId: 'ryt_a1b2c3d4e5f6',
//   endpoint:  'https://api.rytena.dev',
//   interval:  30,
//   name:      'production-api'
// }

Overhead

Rytena is designed to have negligible impact on your application.

| Operation | Overhead | | -------------- | --------------------------------------- | | Quick snapshot | < 1 ms | | Memory usage | < 5 MB | | Deep scan | Only when leak detected, 5-min cooldown | | Network | One HTTP request per interval |


What Rytena doesn't do

Being clear about scope:

  • Not an APM — Rytena focuses on memory. Use Datadog or New Relic for full-stack observability.
  • Not an error tracker — Rytena catches memory issues before they crash. Use Sentry for runtime exceptions.
  • Not a log aggregator — Rytena collects memory metrics only. Use Papertrail or Loggly for logs.

Rytena does one thing better than anyone: finds memory leaks in production Node.js apps and tells you exactly how to fix them.


Example — Try it in 60 seconds

const { Rytena } = require('rytena-agent')
const express    = require('express')

Rytena.init({
  apiKey: process.env.RYTENA_API_KEY
})

const app = express()
const leakyArray = []

// Intentionally leaky endpoint for demo
app.get('/leak', (req, res) => {
  for (let i = 0; i < 1000; i++) {
    leakyArray.push(new Array(1000).fill('leak'))
  }
  res.json({ leaked: leakyArray.length })
})

app.listen(3000)

Run this, hit /leak a few times, and watch Rytena detect the leak in your dashboard.


Data privacy

Rytena collects:

  • Memory metrics (heap used, heap total, RSS, external)
  • Process metadata (hostname, PID, runtime version)
  • Code snippets around detected leak locations (up to 10 lines)

Rytena does NOT collect:

  • Your full source code
  • HTTP request or response data
  • Database queries
  • User data flowing through your application
  • Environment variables

See our Privacy Policy for details.


Documentation

Full docs at rytena.vercel.app/docs


Support


License

MIT © Aayush Shukla