Skip to content

Commit c0a8981

Browse files
committed
Merge remote-tracking branch 'origin/GP-6067_ghidra1_YAJSW_MemoryUse' into patch
2 parents 9a20684 + 66be2b6 commit c0a8981

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

Ghidra/RuntimeScripts/Common/server/server.conf

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
#********************************************************************
1+
#**************************************************************************
22
# Service Wrapper Properties
3-
#********************************************************************
3+
#
4+
# NOTE: It is important to know that the Ghidra Server consists of both
5+
# a controlling wrapper process and its wrapped child process. The
6+
# properties within this file may affect each differently - specifically
7+
# JVM options and how they are specified. The service wrapper relies on
8+
# wrapper.ntservice.additional.N properties within this file, while the
9+
# wrapped Ghidra Server child process relies on wrapper.java.additional.N
10+
# properties. Any changes to ntservice properties require reinstallation
11+
# of the service for them to have any affect.
12+
#**************************************************************************
413

514
# Initial Working Directory (i.e., absolute installation directory path)
615
wrapper.working.dir=${ghidra_home}
@@ -107,11 +116,13 @@ wrapper.java.monitor.deadlock = true
107116
# Main server application class
108117
wrapper.java.app.mainclass=ghidra.server.remote.GhidraServer
109118

110-
# Initial Java Heap Size (in MB)
119+
# Initial Java Heap Size (in MB) - this has the same affect as JVM option -Xms
120+
# NOTE: See ntservice options at bottom of this file for installed service wrapper control
111121
wrapper.java.initmemory=396
112122

113-
# Maximum Java Heap Size (in MB)
123+
# Maximum Java Heap Size (in MB) - this has the same affect as JVM option -Xmx
114124
# See svrREADME.txt file for advice (Server Memory Considerations)
125+
# NOTE: See ntservice options at bottom of this file for installed service wrapper control
115126
wrapper.java.maxmemory=768
116127

117128
# Specify the directory used to store repositories. This directory must be dedicated to this
@@ -259,3 +270,16 @@ wrapper.ntservice.interactive=false
259270
# Restart failed service after 1 minute delay
260271
wrapper.ntservice.failure_actions.actions=RESTART
261272
wrapper.ntservice.failure_actions.actions_delay=60000
273+
274+
# Specify JVM arguments to be used by installed service wrapper process.
275+
276+
# Maximum Java Heap Size (in MB) for installed service wrapper.
277+
# NOTE: See also -Xmx option specification with ghidraSvr script which relates to other
278+
# uses of the YAJSW wrapper (e.g., console mode).
279+
wrapper.ntservice.additional.1=-Xmx1G
280+
281+
# Uncomment to enable detailed memory tracking capability for the installed service wrapper process.
282+
# This will allow command such as the following to dump memory use information:
283+
# jcmd <PID> VM.native_memory summary
284+
# jcmd <PID> VM.native_memory detail
285+
#wrapper.ntservice.additional.2=-XX:NativeMemoryTracking=detail

Ghidra/RuntimeScripts/Linux/server/ghidraSvr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ else
171171
JAVA_CMD="${LS_JAVA_HOME}/bin/java"
172172
fi
173173

174+
# Specify JVM arguments for direct invocations of YAJSW wrapper, including specification
175+
# of maximum heap size (-Xmx) option.
174176
VMARGS=()
177+
VMARGS+=("-Xmx1G")
175178
VMARGS+=("-Djna_tmpdir=${WRAPPER_TMPDIR}")
176179
VMARGS+=("-Djava.io.tmpdir=${WRAPPER_TMPDIR}")
177180

0 commit comments

Comments
 (0)