Skip to content
Snippets Groups Projects
Commit 84a78ff2 authored by felmer's avatar felmer
Browse files

SSDM-3505: allow to set maximum heap size for AS and DSS

SVN: 36273
parent ea58d7d7
No related branches found
No related tags found
No related merge requests found
...@@ -461,6 +461,12 @@ class OpenbisController(_Controller): ...@@ -461,6 +461,12 @@ class OpenbisController(_Controller):
""" Sets the username of the Data Store Server. """ """ Sets the username of the Data Store Server. """
self.dssProperties['username'] = username self.dssProperties['username'] = username
def setAsMaxHeapSize(self, maxHeapSize):
self._setMaxHeapSize("openBIS-server/jetty/etc/openbis.conf", maxHeapSize)
def setDssMaxHeapSize(self, maxHeapSize):
self._setMaxHeapSize("datastore_server/etc/datastore_server.conf", maxHeapSize)
def assertFileExist(self, pathRelativeToInstallPath): def assertFileExist(self, pathRelativeToInstallPath):
""" """
Asserts that the specified path (relative to the installation path) exists. Asserts that the specified path (relative to the installation path) exists.
...@@ -671,3 +677,15 @@ class OpenbisController(_Controller): ...@@ -671,3 +677,15 @@ class OpenbisController(_Controller):
util.writeProperties(self.dssServicePropertiesFile, self.dssProperties) util.writeProperties(self.dssServicePropertiesFile, self.dssProperties)
self.dssPropertiesModified = False self.dssPropertiesModified = False
def _setMaxHeapSize(self, configFile, maxHeapSize):
path = "%s/servers/%s" % (self.installPath, configFile)
lines = []
for line in util.getContent(path):
if line.strip().startswith('JAVA_MEM_OPTS'):
line = re.sub(r'(.*)-Xmx[^ ]+(.*)', r"\1-Xmx%s\2" % maxHeapSize, line)
lines.append(line)
with open(path, "w") as f:
for line in lines:
f.write("%s\n" % line)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment