I have a situation where the one of the JVM options, the "-D" flag is large, over 1000 characters. Is there a limit how large this value can be?
-Dhttp.nonProxyHosts=localhost|127.0.0.1|169.254.169.254|162.31.160.0/20|100.77.147.160/27|100.77.163.160/27|100.77.179.160/27|162.18.168.0/23|162.18.170.0/23|162.18.172.0/23|10.100.0.0/16|.internal|.foobr.com|.execute-api.us-west-2.amazonaws.com|.s3.us-west-2.amazonaws.com|.us-west-2.eks.amazonaws.com|.us-west-2.vpce.amazonaws.com|amazonlinux.us-west-2.amazonaws.com|api.sagemaker.us-west-2.amazonaws.com|cloudformation.us-west-2.amazonaws.com|cloudtrail.us-west-2.amazonaws.com|codebuild-fips.us-west-2.amazonaws.com|codebuild.us-west-2.amazonaws.com|config.us-west-2.amazonaws.com|dynamodb.us-west-2.amazonaws.com|ec2.us-west-2.amazonaws.com|ec2messages.us-west-2.amazonaws.com|elasticloadbalancing.us-west-2.amazonaws.com|events.us-west-2.amazonaws.com|kinesis.us-west-2.amazonaws.com|kms.us-west-2.amazonaws.com|logs.us-west-2.amazonaws.com|monitoring.us-west-2.amazonaws.com|runtime.sagemaker.us-west-2.amazonaws.com|secretsmanager.us-west-2.amazonaws.com|servicecatalog.us-west-2.amazonaws.com|sns.us-west-2.amazonaws.com|ssm.us-west-2.amazonaws.com|ssmmessages.us-west-2.amazonaws.com|sts.us-west-2.amazonaws.com
Yes and no. It's complicated. But mostly good news.
getconf ARG_MAX
usually tells you what it is. On my desktop system it's currently 1048576, on a random linux shell i have access to, it's 2097152. That's a ton of room to grow for you.@
system. You can write java @foo.txt
, which will cause the java executable to open foo.txt
and use the contents of this file as arguments. So, put your giant -D switch in a file, and then use @allThatJazz.txt
instead of -Dreallylongcommandlineoption
. Now you can stop caring about OS imposed args limits.System.getProperty
, your limit is now heap related. We're talking hundreds of megabytes before it becomes unwieldy - 200,000,000 characters maybe.