Skip to content

Commit

Permalink
Remove custom Gradle garbage collection tasks
Browse files Browse the repository at this point in the history
Garbage collection between Gradle tasks should no longer be needed now
that tasks are run on Github servers.
  • Loading branch information
benjamintboyle committed Apr 8, 2021
1 parent 5a678bb commit 02bf19a
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ animalsniffer {
}

jar {
bnd (
bnd(
"Bundle-Name": "rxjava",
"Bundle-Vendor": "RxJava Contributors",
"Bundle-Description": "Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.",
Expand Down Expand Up @@ -126,7 +126,6 @@ plugins.withType(EclipsePlugin) {
}

test {

testLogging {
// showing skipped occasionally should prevent CI timeout due to lack of standard output
events=["skipped", "failed"] // "started", "passed"
Expand Down Expand Up @@ -173,31 +172,13 @@ jacoco {
toolVersion = jacocoVersion
}

task GCandMem(dependsOn: "check") doLast {
logger.lifecycle("Memory usage before: {}", java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
System.gc()
Thread.sleep(200)
logger.lifecycle("Memory usage: {}", java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
}

task GCandMem2(dependsOn: "test") doLast {
logger.lifecycle("Memory usage before: {}", java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
System.gc()
Thread.sleep(200)
logger.lifecycle("Memory usage: {}", java.lang.management.ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed() / 1024.0 / 1024.0)
}

testng.dependsOn GCandMem2

jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}

jacocoTestReport.dependsOn GCandMem

build.dependsOn jacocoTestReport

checkstyle {
Expand Down

0 comments on commit 02bf19a

Please sign in to comment.