I have having a strange issue installing a piece of software that uses a ANT based installation script executed from a JAR using the Oracle JVM (1.8) 64bit.
The issue only appears to happen when the JAR is executed via a Chef run. Note I am using Chef-zero to converge.
- The issue appears to be with the JVM being able to allocate enough memory to execute.
- The issue ONLY appears when Chef executes the JAR, via the OS console itself and CMD everything is fine.
- We have been installing this software for years and have not seen this issue ever prior, until we started using Chef.
There are different errors depending on what I try to set the HEAP values to (note never have we had to set any HEAP options to install previously).
One such error is : Unable to allocate 65536KB bitmaps for parallel garbage collection for the requested 2097152KB heap.
I have also seen other similar errors depending on the values I provide for Xms and Xmx similar to the above.
This has only been seen on Windows systems and only on certain VirtualBox images.
- Some downloaded from net (vagrant) work fine, some fail with above error.
- Any image I build locally fails.
Chef Scripts I have tried (note the java options I have tried many combination, this is latest try):
execute "Install Xstore: #{build_file}" do
command "#{java_home}\\bin\\java -jar #{build_file}"
cwd install_workdir
environment ({ 'PATH' => "c:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\130\\Tools\\Binn\\;#{ENV['PATH']}", 'JAVA_TOOL_OPTIONS' => '-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:/xstore/log/dump.bin' })
not_if { ::Dir.exist?(xstore_install_dir) }
end
ruby_block "Install Xstore: #{build_file}" do
block do
stdout, status = Open3.capture2("#{java_home}\\bin\\java -jar #{build_file}", chdir: "#{install_workdir}")
puts stdout
end
end
Some specs:
- Chef-client: 14.14.29
- Guest VM: Windows 10, Windows 10ltsc - 64bit
- Host: PopOS Linux 19.10
- VirtualBox version: 6.0.14
- Java (guest): 1.8.0_241
- Host Ram 32GB, VM Ram upto 16GB same issues (ram is always 90% free on guest taskmanager, paging file set to System, tried fixed as well)