Skip to content

Commit

Permalink
[SPARK-36393][BUILD][3.1] Try to raise memory for GHA
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

According to the feedback from GitHub, the change causing memory issue has been rolled back. We can try to raise memory again for GA.

### Why are the changes needed?

Trying higher memory settings for GA. It could speed up the testing time.

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

No

### How was this patch tested?

GA

Closes #33657 from viirya/increasing-mem-ga-3.1.

Authored-by: Liang-Chi Hsieh <viirya@gmail.com>
Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>
  • Loading branch information
viirya committed Aug 6, 2021
1 parent 9c95d3f commit aece7e7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Expand Up @@ -169,7 +169,7 @@ jobs:
GITHUB_PREV_SHA: ${{ github.event.before }}
GITHUB_INPUT_BRANCH: ${{ github.event.inputs.target }}
SPARK_LOCAL_IP: localhost
METASPACE_SIZE: 128m
METASPACE_SIZE: 1g
steps:
- name: Checkout Spark repository
uses: actions/checkout@v2
Expand Down
6 changes: 4 additions & 2 deletions build/sbt-launch-lib.bash
Expand Up @@ -117,9 +117,11 @@ addDebugger () {
# so they need not be dicked around with individually.
get_mem_opts () {
local mem=${1:-$sbt_default_mem}
local codecache=128
local codecache=$(( $mem / 8 ))
(( $codecache > 128 )) || codecache=128
(( $codecache < 2048 )) || codecache=2048

echo "-Xms256m -Xmx${mem}m -XX:ReservedCodeCacheSize=${codecache}m"
echo "-Xms${mem}m -Xmx${mem}m -XX:ReservedCodeCacheSize=${codecache}m"
}

require_arg () {
Expand Down
7 changes: 1 addition & 6 deletions dev/run-tests.py
Expand Up @@ -278,12 +278,7 @@ def exec_sbt(sbt_args=()):
"""Will call SBT in the current directory with the list of mvn_args passed
in and returns the subprocess for any further processing"""

sbt_cmd = [os.path.join(SPARK_HOME, "build", "sbt")]

if "GITHUB_ACTIONS" in os.environ:
sbt_cmd = sbt_cmd + ['-mem', '2300']

sbt_cmd = sbt_cmd + sbt_args
sbt_cmd = [os.path.join(SPARK_HOME, "build", "sbt")] + sbt_args

sbt_output_filter = re.compile(b"^.*[info].*Resolving" + b"|" +
b"^.*[warn].*Merging" + b"|" +
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Expand Up @@ -255,7 +255,7 @@
<spark.test.webdriver.chrome.driver></spark.test.webdriver.chrome.driver>
<spark.test.docker.keepContainer>false</spark.test.docker.keepContainer>

<CodeCacheSize>128m</CodeCacheSize>
<CodeCacheSize>1g</CodeCacheSize>
<!-- Needed for consistent times -->
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss z</maven.build.timestamp.format>
</properties>
Expand Down Expand Up @@ -2566,7 +2566,7 @@
<include>**/*Suite.java</include>
</includes>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<argLine>-ea -Xmx3200m -Xss4m -XX:MaxMetaspaceSize=2g -XX:ReservedCodeCacheSize=${CodeCacheSize} -Dio.netty.tryReflectionSetAccessible=true</argLine>
<argLine>-ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g -XX:ReservedCodeCacheSize=${CodeCacheSize} -Dio.netty.tryReflectionSetAccessible=true</argLine>
<environmentVariables>
<!--
Setting SPARK_DIST_CLASSPATH is a simple way to make sure any child processes
Expand Down Expand Up @@ -2616,7 +2616,7 @@
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>SparkTestSuite.txt</filereports>
<argLine>-ea -Xmx3200m -Xss4m -XX:MaxMetaspaceSize=2g -XX:ReservedCodeCacheSize=${CodeCacheSize} -Dio.netty.tryReflectionSetAccessible=true</argLine>
<argLine>-ea -Xmx4g -Xss4m -XX:MaxMetaspaceSize=2g -XX:ReservedCodeCacheSize=${CodeCacheSize} -Dio.netty.tryReflectionSetAccessible=true</argLine>
<stderr/>
<environmentVariables>
<!--
Expand Down
4 changes: 2 additions & 2 deletions project/SparkBuild.scala
Expand Up @@ -1066,12 +1066,12 @@ object TestSettings {
// SPARK-29282 This is for consistency between JDK8 and JDK11.
javaOptions in Test ++= {
val metaspaceSize = sys.env.get("METASPACE_SIZE").getOrElse("1300m")
s"-Xmx3200m -Xss4m -XX:MaxMetaspaceSize=$metaspaceSize -XX:+UseParallelGC -XX:-UseDynamicNumberOfGCThreads"
s"-Xmx4g -Xss4m -XX:MaxMetaspaceSize=$metaspaceSize -XX:+UseParallelGC -XX:-UseDynamicNumberOfGCThreads"
.split(" ").toSeq
},
javaOptions ++= {
val metaspaceSize = sys.env.get("METASPACE_SIZE").getOrElse("1300m")
s"-Xmx3200m -XX:MaxMetaspaceSize=$metaspaceSize".split(" ").toSeq
s"-Xmx4g -XX:MaxMetaspaceSize=$metaspaceSize".split(" ").toSeq
},
// Exclude tags defined in a system property
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest,
Expand Down

0 comments on commit aece7e7

Please sign in to comment.