Skip to content

Commit 3db7e08

Browse files
fix: specify jvm env variables explicitly for local profile (#405)
Signed-off-by: Lenin Mehedy <[email protected]> Co-authored-by: JeffreyDallas <[email protected]>
1 parent b251276 commit 3db7e08

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

resources/profiles/custom-spec.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
local: # 3 nodes, ~950 TPS (Docker Desktop 8 cores, 16 GB RAM)
1+
local: # 3 nodes, ~850 TPS (Docker Desktop 8 cores, 16 GB RAM)
22
consensus: # use chart defaults
3+
root:
4+
extraEnv:
5+
- name: JAVA_HEAP_MIN
6+
value: 1g
7+
- name: JAVA_HEAP_MAX
8+
value: 3g
9+
- name: JAVA_OPTS
10+
value: "-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:ZAllocationSpikeTolerance=2 -XX:ConcGCThreads=2 -XX:ZMarkStackSpaceLimit=1g -XX:MaxDirectMemorySize=1g -XX:MetaspaceSize=100M -Xlog:gc*:gc.log --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true"
311
haproxy: # use chart defaults
412
envoyProxy: # use chart defaults
513
rpcRelay:

src/core/profile_manager.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,17 @@ export class ProfileManager {
150150
const dotItems = dot.dot(items)
151151

152152
for (const key in dotItems) {
153+
let itemKey = key
154+
155+
// if it is an array key like extraEnv[0].JAVA_OPTS, convert it into dot separated key as extraEnv.0.JAVA_OPTS
156+
if (key.indexOf('[') !== -1) {
157+
itemKey = key.replace('[', '.').replace(']', '')
158+
}
159+
153160
if (itemPath) {
154-
this._setValue(`${itemPath}.${key}`, dotItems[key], yamlRoot)
161+
this._setValue(`${itemPath}.${itemKey}`, dotItems[key], yamlRoot)
155162
} else {
156-
this._setValue(key, dotItems[key], yamlRoot)
163+
this._setValue(itemKey, dotItems[key], yamlRoot)
157164
}
158165
}
159166
}
@@ -173,7 +180,6 @@ export class ProfileManager {
173180
for (let nodeIndex = 0; nodeIndex < nodeIds.length; nodeIndex++) {
174181
this._setValue(`hedera.nodes.${nodeIndex}.name`, nodeIds[nodeIndex], yamlRoot)
175182
this._setValue(`hedera.nodes.${nodeIndex}.accountId`, accountMap.get(nodeIds[nodeIndex]), yamlRoot)
176-
this._setChartItems(`hedera.nodes.${nodeIndex}`, profile.consensus, yamlRoot)
177183
}
178184

179185
const stagingDir = Templates.renderStagingDir(

0 commit comments

Comments
 (0)