Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commit changes in README.md #556

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,39 @@ You can compare Gradle against Bazel, Buck, and Maven by specifying their equiva
targets = ["//thing/res_debug"]
}
}
## Configuring Profiling Options

The Gradle Profiler allows you to configure various JVM options using the `GRADLE_PROFILER_OPTS` environment variable. This variable enables you to customize the behavior of the profiler to suit your specific requirements.

### Usage

To set JVM options for the Gradle Profiler, you can use the `GRADLE_PROFILER_OPTS` environment variable. This variable allows you to specify a range of JVM options, including memory settings, garbage collection algorithms, and system properties. Here's an example of how to use `GRADLE_PROFILER_OPTS` to increase the maximum heap size (`-Xmx`):

```bash
export GRADLE_PROFILER_OPTS="-Xmx4g"
```
### Additional Configuration
In addition to setting the maximum heap size, you can use GRADLE_PROFILER_OPTS to configure other JVM options. Here are some examples of additional configurations:
- Enabling a specific garbage collector algorithm:
```bash
export GRADLE_PROFILER_OPTS="-Xmx4g -XX:+UseG1GC"
```
- Setting a custom system property:
```bash
export GRADLE_PROFILER_OPTS="-Xmx4g -Dmy.property=value"
```
- Specifying additional JVM arguments:
```bash
export GRADLE_PROFILER_OPTS="-Xmx4g -XX:MaxMetaspaceSize=256m"
```
You can combine multiple JVM options within the GRADLE_PROFILER_OPTS variable, separated by spaces.
### Applying Configuration
Make sure to apply the configuration before running the Gradle Profiler. You can set the GRADLE_PROFILER_OPTS environment variable in your shell profile (e.g., .bashrc, .zshrc) or directly in your terminal session before executing the profiler commands.

```bash
# Set GRADLE_PROFILER_OPTS environment variable
export GRADLE_PROFILER_OPTS="-Xmx4g"
# Run Gradle Profiler commands
gradle-profiler --benchmark --project-dir <root-dir-of-build> <task>...
```
By configuring GRADLE_PROFILER_OPTS, you can fine-tune the JVM settings to optimize the performance of the Gradle Profiler according to your specific use case.