Skip to content

Commit

Permalink
Make the java_maxmetaspace_size param optional.
Browse files Browse the repository at this point in the history
The default behaviour on most JVM versions is to have no limit for the
Max Meta Space. While I understand wanting to set and limit it, in
v3.0.0 this change is listed as an enhancement while actually being a
breaking change.

When one only reads the changelog without looking at the code,
applications using more then the low default of 128MB will crash.
  • Loading branch information
Bert DEFERME committed Jan 18, 2024
1 parent 8551ea6 commit 9569ee4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
Wildfly::Config_file $host_config = 'host.xml',
String $java_xmx = '512m',
String $java_xms = '256m',
String $java_maxmetaspace_size = '128m',
String $package_ensure = 'present',
Boolean $service_ensure = true,
Boolean $service_manage = true,
Expand Down Expand Up @@ -124,6 +123,7 @@
Optional[String] $package_name = undef,
Optional[String] $package_version = undef,
Variant[Undef, String, Array] $java_opts = undef,
Optional[Stdlib::Datasize] $java_maxmetaspace_size = undef,
Variant[Undef, String, Array] $process_controller_java_opts = undef,
Variant[Undef, String, Array] $host_controller_java_opts = undef,
Optional[String] $jboss_opts = undef,
Expand Down
4 changes: 4 additions & 0 deletions templates/domain.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ fi
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
<% if $wildfly::java_maxmetaspace_size { -%>
JAVA_OPTS="-Xms<%= $wildfly::java_xms %> -Xmx<%= $wildfly::java_xmx %> -XX:MaxMetaspaceSize=<%= $wildfly::java_maxmetaspace_size %>"
<% } else { -%>
JAVA_OPTS="-Xms<%= $wildfly::java_xms %> -Xmx<%= $wildfly::java_xmx %>"
<% } -%>
JAVA_OPTS="$JAVA_OPTS <% if $wildfly::java_opts =~ Array { -%>
<%= $wildfly::java_opts.join(" ") -%>
<% } elsif $wildfly::java_opts =~ String { -%>
Expand Down
4 changes: 4 additions & 0 deletions templates/standalone.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ fi
# Specify options to pass to the Java VM.
#
if [ "x$JAVA_OPTS" = "x" ]; then
<% if $wildfly::java_maxmetaspace_size { -%>
JAVA_OPTS="-Xms<%= $wildfly::java_xms %> -Xmx<%= $wildfly::java_xmx %> -XX:MaxMetaspaceSize=<%= $wildfly::java_maxmetaspace_size %>"
<% } else { -%>
JAVA_OPTS="-Xms<%= $wildfly::java_xms %> -Xmx<%= $wildfly::java_xmx %>"
<% } -%>
JAVA_OPTS="$JAVA_OPTS <%= $wildfly::java_opts %>"
else
echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS"
Expand Down

0 comments on commit 9569ee4

Please sign in to comment.