mirror of
https://github.com/corda/corda.git
synced 2024-12-28 16:58:55 +00:00
commit
eb73a3b68e
@ -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
|
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
|
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
|
configured with a 512mb 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,
|
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).
|
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
|
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:
|
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.
|
The example command above would give a 1 gigabyte Java heap.
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ task buildCordaJAR(type: FatCapsule, dependsOn: project(':node').compileJava) {
|
|||||||
// NOTE: these can be overridden in node.conf.
|
// NOTE: these can be overridden in node.conf.
|
||||||
//
|
//
|
||||||
// If you change these flags, please also update Driver.kt
|
// If you change these flags, please also update Driver.kt
|
||||||
jvmArgs = ['-Xmx200m', '-XX:+UseG1GC']
|
jvmArgs = ['-Xmx512m', '-XX:+UseG1GC']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ data class NodeParameters(
|
|||||||
val verifierType: VerifierType = VerifierType.InMemory,
|
val verifierType: VerifierType = VerifierType.InMemory,
|
||||||
val customOverrides: Map<String, Any?> = emptyMap(),
|
val customOverrides: Map<String, Any?> = emptyMap(),
|
||||||
val startInSameProcess: Boolean? = null,
|
val startInSameProcess: Boolean? = null,
|
||||||
val maximumHeapSize: String = "200m",
|
val maximumHeapSize: String = "512m",
|
||||||
val logLevel: String? = null
|
val logLevel: String? = null
|
||||||
) {
|
) {
|
||||||
fun withProvidedName(providedName: CordaX500Name?): NodeParameters = copy(providedName = providedName)
|
fun withProvidedName(providedName: CordaX500Name?): NodeParameters = copy(providedName = providedName)
|
||||||
|
@ -77,7 +77,7 @@ interface DriverDSL {
|
|||||||
* in. If null the Driver-level value will be used.
|
* 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
|
* @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
|
* 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.
|
* @return A [CordaFuture] on the [NodeHandle] to the node. The future will complete when the node is available.
|
||||||
*/
|
*/
|
||||||
fun startNode(
|
fun startNode(
|
||||||
|
@ -225,7 +225,7 @@ class DriverDSLImpl(
|
|||||||
verifierType: VerifierType,
|
verifierType: VerifierType,
|
||||||
customOverrides: Map<String, Any?>,
|
customOverrides: Map<String, Any?>,
|
||||||
startInSameProcess: Boolean? = null,
|
startInSameProcess: Boolean? = null,
|
||||||
maximumHeapSize: String = "200m",
|
maximumHeapSize: String = "512m",
|
||||||
p2pAddress: NetworkHostAndPort = portAllocation.nextHostAndPort()): CordaFuture<NodeHandle> {
|
p2pAddress: NetworkHostAndPort = portAllocation.nextHostAndPort()): CordaFuture<NodeHandle> {
|
||||||
val rpcAddress = portAllocation.nextHostAndPort()
|
val rpcAddress = portAllocation.nextHostAndPort()
|
||||||
val rpcAdminAddress = portAllocation.nextHostAndPort()
|
val rpcAdminAddress = portAllocation.nextHostAndPort()
|
||||||
@ -376,7 +376,7 @@ class DriverDSLImpl(
|
|||||||
)
|
)
|
||||||
val cordaConfig = typesafe.parseAsNodeConfiguration()
|
val cordaConfig = typesafe.parseAsNodeConfiguration()
|
||||||
val config = NodeConfig(rawConfig, cordaConfig)
|
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 {
|
private fun queryWebserver(handle: NodeHandle, process: Process): WebserverHandle {
|
||||||
@ -638,7 +638,7 @@ class DriverDSLImpl(
|
|||||||
monitorPort,
|
monitorPort,
|
||||||
systemProperties,
|
systemProperties,
|
||||||
cordappPackages,
|
cordappPackages,
|
||||||
"200m",
|
"512m",
|
||||||
*extraCmdLineFlag
|
*extraCmdLineFlag
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -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.
|
// - 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
|
// If you change these flags, please also update Driver.kt
|
||||||
jvmArgs = ['-Xmx200m', '-XX:+UseG1GC']
|
jvmArgs = ['-Xmx512m', '-XX:+UseG1GC']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user