Commit 349bd864 authored by charlie-ablett's avatar charlie-ablett
Browse files

Set Java max/initial heap size, ENV variables so sysadmins can tune.

parent f83862be
GIT
remote: https://gitlab.coko.foundation/INK/ink-step.git
revision: c0dcc1a38e16b49ea5d66f7eb988fbb96079b156
revision: 4976e3da2c3f39c58c88e2a2cd76ae6a9f4fbc9c
specs:
ink_step (1.3.0)
ink_step (1.3.2)
awesome_print
httparty
rubyzip
......@@ -10,7 +10,7 @@ GIT
PATH
remote: .
specs:
inkstep_coko_conversion (1.0.6)
inkstep_coko_conversion (1.0.7)
GEM
remote: https://rubygems.org/
......
......@@ -20,7 +20,7 @@ module Utilities
# java -jar Saxon-HE-9.7.0-4.jar -s:some_file.docx -xsl:xsl_file_path.xsl -o:conversion_output.html
log_as_step "Applying xsl..."
command = "java -jar #{Shellwords.escape(saxon_jar_path)} -s:#{Shellwords.escape(@original_file_path)} -xsl:#{Shellwords.escape(xsl_file_path)} -o:#{Shellwords.escape(output_file_path)}"
command = "java #{max_java_heap_size} #{initial_java_heap_size} -jar #{Shellwords.escape(saxon_jar_path)} -s:#{Shellwords.escape(@original_file_path)} -xsl:#{Shellwords.escape(xsl_file_path)} -o:#{Shellwords.escape(output_file_path)}"
log_as_step "Running command '#{command}'"
Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
......@@ -47,5 +47,21 @@ module Utilities
root = File.expand_path '../..', File.dirname(__FILE__)
File.join(root, "coko_conversion", "utilities", "Saxon-HE-9.7.0-4.jar")
end
def max_java_heap_size
max_heap = ENV['MAX_JAVA_HEAP_SIZE']
if max_heap
return "-Xmx#{max_heap}" # or 4096m
end
""
end
def initial_java_heap_size
init_heap = ENV['INIT_JAVA_HEAP_SIZE']
if init_heap
return "-Xms#{init_heap}" # or 128m
end
""
end
end
end
module CokoConversion
VERSION = '1.0.7'
VERSION = '1.0.8'
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment