Faced the same error in freestyle job when evninject is set twice: in General section of job config and in a build step. with 50% chance build stuck on envinject build step, fills heap memory with an int[] objects, gc reaches overhead threshold, and Full GC runs frequently.
Workaround:
1. kill problem thread through javamelody (Monitoring Plugin,) in our case it was in RUNNING state on:
at java.util.Arrays.copyOf(Arrays.java:3332)
2. Move all envinject parametes into one call (we have move all into buld step)
Unfortunately I will not have time to work on EnvInject issues for a while. I decided to unassign all issues so that somebody can take them and finalize.
Context: The plugin has been waiting for adoption for ~2 years. During all this time I was trying to keep this plugin afloat by reviewing the incoming pull requests, fixing defects and keeping the codebase up to date to simplify the handover. But I have not been using this plugin on my own so that such maintenance was a bit lame. I invite all active users to contribute to the plugin by taking ownership of this plugin and of EnvInject API. I am happy to provide any required knowledge transfers and do some assistance during the first months of maintenance