Skip to main content

Command Palette

Search for a command to run...

DevTask: Why I Built a Specialized TUI Process Manager in Go to Hunt Down Hung Java and Gradle Daemons

Updated
4 min readView as Markdown
DevTask: Why I Built a Specialized TUI Process Manager in Go to Hunt Down Hung Java and Gradle Daemons

Every developer who works with Android Studio, Gradle, Kotlin, or the JVM ecosystem on Linux knows that familiar moment of frustration: your laptop fans sound like a jet engine, you pop open a terminal, run a quick inspection command, and discover that 15 to 20 gigabytes of your RAM have quietly evaporated into thin air.

This is the story of how a routine terminal diagnosis turned into DevTask, an open-source terminal user interface (TUI) process manager built in Go using the Bubble Tea framework.

The Real Problem: The Mystery of Ghost Daemons

I was in the middle of development when my system started feeling unusually sluggish. Running the classic terminal check:

ps aux | grep java

The output was eye-opening: A Gradle Daemon 8.14 running under OpenJDK 17 hoarding more than 5 GB of RAM. A Gradle Daemon 8.14 running under Android Studio JBR holding several hundred megabytes. A Kotlin Compile Daemon 2.0.21 that had been sitting idle for over an hour. Another Kotlin Compile Daemon 2.2.20 consuming another gigabyte of memory.

Standard tools like htop or the raw ps command present a wall of text filled with 500-character classpath arguments. Distinguishing which process is actively compiling and which one has been hung for the past 45 minutes doing nothing requires patience, tedious parsing, and custom bash scripts.

That sparked an idea: Why not build an interactive, specialized terminal task manager for developers that runs seamlessly in the console?

The Vision: Designing DevTask

The goal was not to clone general-purpose monitors like btop or htop, but to tackle the specific pain points of modern software development environments:

Intelligent Categorization: The tool parses messy JVM command-line strings and tells you clearly: This is Gradle Daemon 8.14 (JBR) or This is Kotlin Daemon 2.2.

Automated Idle Heuristics: If a process has been running for more than 15 minutes and its CPU consumption is below 1.0 percent, it gets flagged with an amber IDLE badge as an obvious candidate for cleanup.

Hierarchical Tree Navigation with Drill-Down: Group processes by category such as Java and JVM, Kotlin, Node.js, and Docker, and allow developers to expand or collapse each cluster using the arrow keys or Enter.

Minimum Memory Filter: Automatically filter out lightweight background processes to keep your attention focused strictly on heavy daemons using 100 MB of RAM or more.

Permanent Slash Command Prompt: Type runtime commands like /config idle 20m, /config mem 150, or /kill-single to configure thresholds and take action without leaving the terminal view.

The Tech Stack: Why Go and Bubble Tea

For the terminal user interface, the Charm ecosystem was the natural choice: Bubble Tea: The Elm-inspired architecture (Model, Update, View) ensures state management, periodic sampling ticks, and view transitions remain clean and predictable. Lipgloss: Provides a modern, vibrant dark theme with custom borders and clear badges for active versus idle states. Gopsutil: Delivers fast, non-blocking process sampling and system metrics on Linux without freezing the terminal rendering loop.

How the User Experience Works

When you launch DevTask in your terminal, you are greeted with a header showing visual CPU and RAM meters alongside a live count of detected idle daemons.

The main table presents clean grouped categories. You navigate using arrow keys or vim shortcuts (j and k). Hitting Enter on a group expands it, displaying each child process with its exact PID, memory footprint in megabytes, CPU percentage, runtime duration, and idle status.

At the bottom of the screen: A dedicated inspector panel automatically extracts JVM memory flags like -Xmx, -Xms, and Metaspace, plus the current working directory. A permanent command prompt lets you update thresholds on the fly and persist them to your local JSON configuration.

When it comes to terminating stubborn daemons, pressing a key opens a confirmation modal where you can toggle between a graceful SIGTERM and a forced SIGKILL (-9) with a single keystroke.

Open Source under GPLv3

I chose to release DevTask under the GNU General Public License v3.0 (GPLv3). The reason is straightforward: I want any developer to be able to use, inspect, extend, and learn from this tool freely, while ensuring that the project and any derivatives remain free and open source for the developer community.

You can check out the source code, try it out, or contribute on GitHub: https://github.com/degomon/devtask

If you also struggle with rogue daemons eating away your system memory during daily builds, give DevTask a spin. Contributions, issues, and feature suggestions are warmly welcome!