A low-overhead, non-blocking I/O external Process implementation for Java, replacing java.lang.ProcessBuilder and Process.
NuProcess is a Java library that provides a low-overhead, non-blocking I/O implementation for executing and managing external processes. It solves the performance and resource issues of Java's standard Process API by eliminating the need for per-process "pumper" threads and reducing memory overhead through native OS integration.
Java developers who need to spawn and interact with many external processes efficiently, such as those building build tools, task runners, or system automation utilities.
Developers choose NuProcess for its significantly lower memory and thread overhead compared to standard Java Process, enabling scalable process execution without compromising on non-blocking I/O performance.
Low-overhead, non-blocking I/O, external Process implementation for Java
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses platform-specific APIs like epoll on Linux, kqueue on macOS, and IO Completion Ports on Windows to avoid blocking threads on pipe I/O, as detailed in the README's approach to eliminating pumper threads.
Employs vfork() on Unix-based systems to prevent temporary process duplication, enabling hundreds of processes even with only 128Mb JVM memory, compared to standard Process requiring 3Gb for 500 processes.
Replaces per-process pumper threads with a small, configurable thread pool managed by the library, as described in the Settings section with properties like com.zaxxer.nuprocess.threads.
Provides a NuProcessHandler interface for callback-driven notifications on process output, input readiness, and termination, allowing fine-grained control over I/O streams.
Versions 1.0.0 and above contain breaking API changes from 0.9.7, which can be disruptive for existing projects during upgrades, as noted in the README.
Only supports Linux, Windows, and macOS, with Linux requiring kernel 2.6.17 or higher, excluding older systems or other Unix variants, as listed in the Limitations section.
Relies on JNA for native OS APIs, adding a dependency that can introduce compatibility issues or native library loading problems, especially in containerized environments.