Skip to content

CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit

‑Xenablestringconstantgc / ‑Xdisablestringconstantgc

These options enable or disable the collection of strings from the string intern table.


Setting Effect Default
-Xenablestringconstantgc Enable collection yes
-Xdisablestringconstantgc Disable collection

This option is not supported with the balanced GC policy (-Xgcpolicy:balanced).