diff --git a/build.gradle b/build.gradle index ee8d223b..ace5e088 100644 --- a/build.gradle +++ b/build.gradle @@ -183,7 +183,7 @@ jib { } } container { - jvmFlags = ['-Xms1024m', '-Xmx1024m', '-XX:+UseG1GC', '-XX:+ExitOnOutOfMemoryError'] + jvmFlags = ['-XX:+UseG1GC', '-XX:+ExitOnOutOfMemoryError', '-Xms1024M'] mainClass = 'io.emeraldpay.dshackle.StarterKt' args = [] ports = ['2448', '2449', '8545'] diff --git a/src/main/kotlin/io/emeraldpay/dshackle/Starter.kt b/src/main/kotlin/io/emeraldpay/dshackle/Starter.kt index 09bfd07f..b1af0743 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/Starter.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/Starter.kt @@ -31,6 +31,10 @@ private val log = LoggerFactory.getLogger(Starter::class.java) fun main(args: Array) { Schedulers.enableMetrics() + + val maxMemory: Long = Runtime.getRuntime().maxMemory() / (1024 * 1024).toLong() + log.info("Max heap size: {} MB", maxMemory) + val app = SpringApplication(Starter::class.java) app.setDefaultProperties(ResourcePropertySource("version.properties").source) app.setBanner(ResourceBanner(ClassPathResource("banner.txt")))