Java Agents consume licenses on a per JVM basis and there is a 1:1 mapping between JVMs and license units. For example, if you have 5 JVMs running on the same host, they will consume 5 licenses. For details on Java license entitlements, see License Entitlements and Restrictions.
Starting in Controller v4.3+, the only way to release (free up) a license is to stop or uninstall the agent completely. In the case of a Java Agent, you would need to shut down the JVM. For instructions on how to uninstall the Java Agent, read our complete documentation.