spark-instrumented-optimizer/project
Dongjoon Hyun d7df7a805f [SPARK-36195][BUILD] Set MaxMetaspaceSize JVM option to 2g
### What changes were proposed in this pull request?

This PR aims to set `MaxMetaspaceSize` to `2g` because it's increasing the native memory consumption unlimitedly by default. The unlimited increasing memory causes GitHub Action flakiness. The value I observed during `hive` module test was over 1.8G and growing.

- https://docs.oracle.com/javase/10/gctuning/other-considerations.htm#JSGCT-GUID-BFB89453-60C0-42AC-81CA-87D59B0ACE2E
> Starting with JDK 8, the permanent generation was removed and the class metadata is allocated in native memory. The amount of native memory that can be used for class metadata is by default unlimited. Use the option -XX:MaxMetaspaceSize to put an upper limit on the amount of native memory used for class metadata.

In addition, I increased the following memory limit to 4g consistently from two places.
```xml
- <jvmArg>-Xms2048m</jvmArg>
- <jvmArg>-Xmx2048m</jvmArg>
+ <jvmArg>-Xms4g</jvmArg>
+ <jvmArg>-Xmx4g</jvmArg>
```

```scala
- javaOptions += "-Xmx3g",
+ javaOptions ++= "-Xmx4g -XX:MaxMetaspaceSize=2g".split(" ").toSeq,
```

### Why are the changes needed?

This will reduce the flakiness in CI environment by limiting the memory usage explicitly.

When we limit it with `1g`, Hive module fails with `OOM` like the following.
```
java.lang.OutOfMemoryError: Metaspace
Error: Exception in thread "dispatcher-event-loop-110" java.lang.OutOfMemoryError: Metaspace
```

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

Closes #33405 from dongjoon-hyun/SPARK-36195.

Lead-authored-by: Dongjoon Hyun <dongjoon@apache.org>
Co-authored-by: Kyle Bendickson <kbendickson@apple.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
2021-07-18 10:15:15 -07:00
..
build.properties [SPARK-36110][BUILD] Upgrade SBT to 1.5.5 2021-07-13 13:14:10 +09:00
MimaBuild.scala [SPARK-36004][INFRA] Update MiMa and audit API changes 2021-07-06 07:16:07 -05:00
MimaExcludes.scala [SPARK-35276][CORE] Calculate checksum for shuffle data and write as checksum file 2021-07-17 00:23:14 -05:00
plugins.sbt [SPARK-33996][BUILD][FOLLOW-UP] Match SBT's plugin checkstyle version to Maven's 2021-07-05 18:55:45 +09:00
SparkBuild.scala [SPARK-36195][BUILD] Set MaxMetaspaceSize JVM option to 2g 2021-07-18 10:15:15 -07:00