Skip to main content

A command to trigger a full java garbage collection via the jcmd tool. On systems which use the systemd init system, you can specify the service name as the program argument. The -r option can also be used on systemd based systems to allow have this utility attempt to automatically restart the service if the jcmd garbage collection fails.

Requirements

  • Tested on python 2.7 and python 3

  • No 3rd party libraries required

Installation

Using pip is the preferred method to install this tool, and will install the package from pypi. pip install java-gc

It can also be installed via pip from a local copy of the source repo, pip install . from the repo directory should do the trick. Running make install should also work as well.

Usage

usage: java-gc [-h] [-u USER] [-t T] [-r]
[-l {debug,info,warning,error,critical}] [-v]
proc

Trigger a full GC on a java process

positional arguments:
proc The service name, or pid, to trigger the GC on

optional arguments:
-h, –help show this help message and exit
-u USER, –user USER User owning the process (default to current user)
-t T, –timeout T seconds to wait for GC before raising error
-r, –restart restart the service if timeout occurred, else exit
with error
-l {debug,info,warning,error,critical}, –loglevel {debug,info,warning,error,critical}
set log level
-v, –version print program version and exit

Contributing

The usual github model for forking the repo and creating a pull request is the preferred way to contribute to this tool. Bug fixes, enhancements, doc updates, translations are always welcomed.

Building from source

A Makefile has been included in the repository to handle the steps of creating the package and uploading it to pypi. If you don’t have the make utility installed, the contents of the Makefile should be instructive (and simple) enough to execute manually.

The following targets are available in the Makefile:

  • package - the default target, calls the setup.py script to create the package to upload to pypi.

  • upload - depends on the package target, and uploads the generated package archive to pypi.

  • install - use pip to install the package locally

  • clean - clean up the artifacts left by the package step.

  • distclean - depends on the clean target, and additionally cleans up misc. files.

Release files for java-gc 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for java-gc 0.2.0
File Interpreter ABI Platform
java_gc-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / java_gc-0.2.0-py2.py3-none-any.whl

Download URL java_gc-0.2.0-py2.py3-none-any.whl
Size 6.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
72ccb09b39412453ac7aa45ade4ffdb064010c38b1238ee38418c9e6f71687dc
BLAKE2b-256 checksum
How to use checksums
0b61c3f657515881eedf528178247c29a4a39f7b8d3e786370a990df79858bac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page