How to pass Java options for the JVM that runs Gradle?

How do I pass Java memory-management options, such as “-Xmx”, to the Gradle daemon and to its child processes?

(Asking because I’l like to run gradle in an environment where “ulimit -v” has a value other than “unlimited”, see OpenJDK bug JDK-8071445 .)

All Java processes launched should have default -Xmx values.
So, as your goal is to not start without -Xmx if I got you right, you should not need to do anything.
Other than that, you could use the org.gradle.jvmargs Gradle property to set the value for the Gradle daemon, but you need to set it also separately for started subprocesses on the according tasks.

Alternatively you could probably also use JAVA_TOOL_OPTIONS environment variable that is automatically considered by any Java process started and is handled by Java itself, totally independent of Gradle. But I don’t know how there the precedence is.