diff --git a/docs/source/node-administration.rst b/docs/source/node-administration.rst index a5defeae0f..831e67e514 100644 --- a/docs/source/node-administration.rst +++ b/docs/source/node-administration.rst @@ -136,14 +136,14 @@ Memory usage and tuning All garbage collected programs can run faster if you give them more memory, as they need to collect less frequently. As a default JVM will happily consume all the memory on your system if you let it, Corda is -configured with a relatively small 200mb Java heap by default. When other overheads are added, this yields -a total memory usage of about 500mb for a node (the overheads come from things like compiled code, metadata, +configured with a 512mb Java heap by default. When other overheads are added, this yields +a total memory usage of about 800mb for a node (the overheads come from things like compiled code, metadata, off-heap buffers, thread stacks, etc). If you want to make your node go faster and profiling suggests excessive GC overhead is the cause, or if your node is running out of memory, you can give it more by running the node like this: -``java -Xmx1024m -jar corda.jar`` +``java -Dcapsule.jvm.args="-Xmx1024m" -jar corda.jar`` The example command above would give a 1 gigabyte Java heap. diff --git a/node/capsule/build.gradle b/node/capsule/build.gradle index f590009b7a..aab294cda1 100644 --- a/node/capsule/build.gradle +++ b/node/capsule/build.gradle @@ -67,7 +67,7 @@ task buildCordaJAR(type: FatCapsule, dependsOn: project(':node').compileJava) { // NOTE: these can be overridden in node.conf. // // If you change these flags, please also update Driver.kt - jvmArgs = ['-Xmx200m', '-XX:+UseG1GC'] + jvmArgs = ['-Xmx512m', '-XX:+UseG1GC'] } } diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt index 98284bf2c1..0e159752cd 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt @@ -154,7 +154,7 @@ data class NodeParameters( val verifierType: VerifierType = VerifierType.InMemory, val customOverrides: Map = emptyMap(), val startInSameProcess: Boolean? = null, - val maximumHeapSize: String = "200m", + val maximumHeapSize: String = "512m", val logLevel: String? = null ) { fun withProvidedName(providedName: CordaX500Name?): NodeParameters = copy(providedName = providedName) diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/driver/DriverDSL.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/driver/DriverDSL.kt index 41e3b3714b..44deb54d9f 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/driver/DriverDSL.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/driver/DriverDSL.kt @@ -77,7 +77,7 @@ interface DriverDSL { * in. If null the Driver-level value will be used. * @param maximumHeapSize The maximum JVM heap size to use for the node as a [String]. By default a number is interpreted * as being in bytes. Append the letter 'k' or 'K' to the value to indicate Kilobytes, 'm' or 'M' to indicate - * megabytes, and 'g' or 'G' to indicate gigabytes. The default value is "200m" = 200 megabytes. + * megabytes, and 'g' or 'G' to indicate gigabytes. The default value is "512m" = 512 megabytes. * @return A [CordaFuture] on the [NodeHandle] to the node. The future will complete when the node is available. */ fun startNode( diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt index aafaf7b43b..462e9ac8a0 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt @@ -225,7 +225,7 @@ class DriverDSLImpl( verifierType: VerifierType, customOverrides: Map, startInSameProcess: Boolean? = null, - maximumHeapSize: String = "200m", + maximumHeapSize: String = "512m", p2pAddress: NetworkHostAndPort = portAllocation.nextHostAndPort()): CordaFuture { val rpcAddress = portAllocation.nextHostAndPort() val rpcAdminAddress = portAllocation.nextHostAndPort() @@ -376,7 +376,7 @@ class DriverDSLImpl( ) val cordaConfig = typesafe.parseAsNodeConfiguration() val config = NodeConfig(rawConfig, cordaConfig) - return startNodeInternal(config, webAddress, null, "200m", localNetworkMap) + return startNodeInternal(config, webAddress, null, "512m", localNetworkMap) } private fun queryWebserver(handle: NodeHandle, process: Process): WebserverHandle { @@ -638,7 +638,7 @@ class DriverDSLImpl( monitorPort, systemProperties, cordappPackages, - "200m", + "512m", *extraCmdLineFlag ) diff --git a/tools/explorer/capsule/build.gradle b/tools/explorer/capsule/build.gradle index 0c9e59231d..b2e6e37fe4 100644 --- a/tools/explorer/capsule/build.gradle +++ b/tools/explorer/capsule/build.gradle @@ -54,7 +54,7 @@ task buildExplorerJAR(type: FatCapsule, dependsOn: project(':tools:explorer').co // - Switch to the G1 GC which is going to be the default in Java 9 and gives low pause times/string dedup. // // If you change these flags, please also update Driver.kt - jvmArgs = ['-Xmx200m', '-XX:+UseG1GC'] + jvmArgs = ['-Xmx512m', '-XX:+UseG1GC'] } }