From 401a6a30b18e6abd0c8d631b022313e95e8e5d4b Mon Sep 17 00:00:00 2001 From: Sander Kromwijk Date: Thu, 14 Feb 2019 06:21:23 -0500 Subject: [PATCH] Specify heap dump path (#424) Fixes #423 --- .../palantir/gradle/dist/service/tasks/LaunchConfigTask.java | 1 + .../gradle/dist/service/ServiceDistributionPluginTests.groovy | 3 +++ 2 files changed, 4 insertions(+) diff --git a/gradle-sls-packaging/src/main/groovy/com/palantir/gradle/dist/service/tasks/LaunchConfigTask.java b/gradle-sls-packaging/src/main/groovy/com/palantir/gradle/dist/service/tasks/LaunchConfigTask.java index 7394428f5..4effd84e8 100644 --- a/gradle-sls-packaging/src/main/groovy/com/palantir/gradle/dist/service/tasks/LaunchConfigTask.java +++ b/gradle-sls-packaging/src/main/groovy/com/palantir/gradle/dist/service/tasks/LaunchConfigTask.java @@ -58,6 +58,7 @@ public class LaunchConfigTask extends DefaultTask { "-XX:+CrashOnOutOfMemoryError", "-Djava.io.tmpdir=var/data/tmp", "-XX:ErrorFile=var/log/hs_err_pid%p.log", + "-XX:HeapDumpPath=var/log", // Set DNS cache TTL to 20s to account for systems such as RDS and other // AWS-managed systems that modify DNS records on failover. "-Dsun.net.inetaddr.ttl=20" diff --git a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/ServiceDistributionPluginTests.groovy b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/ServiceDistributionPluginTests.groovy index a51069e00..a57b78797 100644 --- a/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/ServiceDistributionPluginTests.groovy +++ b/gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/ServiceDistributionPluginTests.groovy @@ -402,6 +402,7 @@ class ServiceDistributionPluginTests extends GradleIntegrationSpec { '-XX:+CrashOnOutOfMemoryError', '-Djava.io.tmpdir=var/data/tmp', '-XX:ErrorFile=var/log/hs_err_pid%p.log', + '-XX:HeapDumpPath=var/log', '-Dsun.net.inetaddr.ttl=20', '-XX:+UseParallelOldGC', '-Xmx4M', @@ -424,6 +425,7 @@ class ServiceDistributionPluginTests extends GradleIntegrationSpec { '-XX:+CrashOnOutOfMemoryError', '-Djava.io.tmpdir=var/data/tmp', '-XX:ErrorFile=var/log/hs_err_pid%p.log', + '-XX:HeapDumpPath=var/log', '-Dsun.net.inetaddr.ttl=20', '-Xmx4M', '-Djavax.net.ssl.trustStore=truststore.jks']) @@ -460,6 +462,7 @@ class ServiceDistributionPluginTests extends GradleIntegrationSpec { '-XX:+CrashOnOutOfMemoryError', '-Djava.io.tmpdir=var/data/tmp', '-XX:ErrorFile=var/log/hs_err_pid%p.log', + '-XX:HeapDumpPath=var/log', '-Dsun.net.inetaddr.ttl=20', "-XX:+PrintGCDateStamps", "-XX:+PrintGCDetails",