diff --git a/docs/source/node-administration.rst b/docs/source/node-administration.rst index 9acaee8b6e..9943a0099d 100644 --- a/docs/source/node-administration.rst +++ b/docs/source/node-administration.rst @@ -134,14 +134,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 ca320e6b5d..d995f61fe7 100644 --- a/node/capsule/build.gradle +++ b/node/capsule/build.gradle @@ -57,7 +57,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 0526a3fc2d..104ed2d332 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 @@ -144,7 +144,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" ) { fun withProvidedName(providedName: CordaX500Name?): NodeParameters = copy(providedName = providedName) fun withRpcUsers(rpcUsers: List): NodeParameters = copy(rpcUsers = rpcUsers) 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 6ef75b3327..71c6db96b1 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 @@ -67,7 +67,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 942159efa8..8a69319b06 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 @@ -215,7 +215,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() @@ -366,7 +366,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 { @@ -632,7 +632,7 @@ class DriverDSLImpl( monitorPort, systemProperties, cordappPackages, - "200m", + "512m", *extraCmdLineFlag ) diff --git a/tools/explorer/capsule/build.gradle b/tools/explorer/capsule/build.gradle index e872daf3b9..ac4ccd1e0e 100644 --- a/tools/explorer/capsule/build.gradle +++ b/tools/explorer/capsule/build.gradle @@ -44,7 +44,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'] } }