diff --git a/docs/jre-open_jdk_jre.md b/docs/jre-open_jdk_jre.md index ecb3c72ad8..8e7af49b47 100644 --- a/docs/jre-open_jdk_jre.md +++ b/docs/jre-open_jdk_jre.md @@ -39,7 +39,7 @@ The following optional properties may be specified in the `memory_sizes` mapping | Name | Description | ---- | ----------- | `heap` | The maximum heap size to use. It may be a single value such as `64m` or a range of acceptable values such as `128m..256m`. It is used to calculate the value of the Java command line options `-Xmx` and `-Xms`. -| `metaspace` | The maximum Metaspace size to use. It is applicable to versions of OpenJDK from 1.8 onwards. It may be a single value such as `64m` or a range of acceptable values such as `128m..256m`. It is used to calculate the value of the Java command line options `-XX:MaxMetaspaceSize=` and `-XX:MetaspaceSize=`. +| `metaspace` | The maximum Metaspace size to use. It is applicable to versions of OpenJDK from 1.8 onwards. It may be a single value such as `64m` or a range of acceptable values such as `128m..256m`. It is used to calculate the value of the Java command line options `-XX:MaxMetaspaceSize=`. | `native` | The amount of memory to reserve for native memory allocation. It should normally be omitted or specified as a range with no upper bound such as `100m..`. It does not correspond to a switch on the Java command line. | `permgen` | The maximum PermGen size to use. It is applicable to versions of OpenJDK earlier than 1.8. It may be a single value such as `64m` or a range of acceptable values such as `128m..256m`. It is used to calculate the value of the Java command line options `-XX:MaxPermSize=` and `-XX:PermSize=`. | `stack` | The stack size to use. It may be a single value such as `2m` or a range of acceptable values such as `2m..4m`. It is used to calculate the value of the Java command line option `-Xss`. diff --git a/docs/jre-oracle_jre.md b/docs/jre-oracle_jre.md index 1b5612eb29..ee6cc651d6 100644 --- a/docs/jre-oracle_jre.md +++ b/docs/jre-oracle_jre.md @@ -48,7 +48,7 @@ The following optional properties may be specified in the `memory_sizes` mapping | Name | Description | ---- | ----------- | `heap` | The maximum heap size to use. It may be a single value such as `64m` or a range of acceptable values such as `128m..256m`. It is used to calculate the value of the Java command line options `-Xmx` and `-Xms`. -| `metaspace` | The maximum Metaspace size to use. It is applicable to versions of Oracle from 1.8 onwards. It may be a single value such as `64m` or a range of acceptable values such as `128m..256m`. It is used to calculate the value of the Java command line options `-XX:MaxMetaspaceSize=` and `-XX:MetaspaceSize=`. +| `metaspace` | The maximum Metaspace size to use. It is applicable to versions of Oracle from 1.8 onwards. It may be a single value such as `64m` or a range of acceptable values such as `128m..256m`. It is used to calculate the value of the Java command line option `-XX:MaxMetaspaceSize=`. | `native` | The amount of memory to reserve for native memory allocation. It should normally be omitted or specified as a range with no upper bound such as `100m..`. It does not correspond to a switch on the Java command line. | `permgen` | The maximum PermGen size to use. It is applicable to versions of Oracle earlier than 1.8. It may be a single value such as `64m` or a range of acceptable values such as `128m..256m`. It is used to calculate the value of the Java command line options `-XX:MaxPermSize=` and `-XX:PermSize=`. | `stack` | The stack size to use. It may be a single value such as `2m` or a range of acceptable values such as `2m..4m`. It is used to calculate the value of the Java command line option `-Xss`. diff --git a/lib/java_buildpack/jre/memory/openjdk_memory_heuristic_factory.rb b/lib/java_buildpack/jre/memory/openjdk_memory_heuristic_factory.rb index e36017a734..35c28ad3e1 100644 --- a/lib/java_buildpack/jre/memory/openjdk_memory_heuristic_factory.rb +++ b/lib/java_buildpack/jre/memory/openjdk_memory_heuristic_factory.rb @@ -47,7 +47,7 @@ def create_memory_heuristic(sizes, heuristics, version) JAVA_OPTS = { 'heap' => ->(v) { %W(-Xmx#{v} -Xms#{v}) }, - 'metaspace' => ->(v) { %W(-XX:MaxMetaspaceSize=#{v} -XX:MetaspaceSize=#{v}) }, + 'metaspace' => ->(v) { %W(-XX:MaxMetaspaceSize=#{v}) }, 'permgen' => ->(v) { %W(-XX:MaxPermSize=#{v} -XX:PermSize=#{v}) }, 'stack' => ->(v) { ["-Xss#{v}"] } }.freeze diff --git a/spec/java_buildpack/jre/memory/openjdk_memory_heuristic_factory_spec.rb b/spec/java_buildpack/jre/memory/openjdk_memory_heuristic_factory_spec.rb index 3e7a755121..312e0422f2 100644 --- a/spec/java_buildpack/jre/memory/openjdk_memory_heuristic_factory_spec.rb +++ b/spec/java_buildpack/jre/memory/openjdk_memory_heuristic_factory_spec.rb @@ -42,7 +42,7 @@ let(:expected_java_memory_options) do { 'heap' => ->(v) { %W(-Xmx#{v} -Xms#{v}) }, - 'metaspace' => ->(v) { %W(-XX:MaxMetaspaceSize=#{v} -XX:MetaspaceSize=#{v}) }, + 'metaspace' => ->(v) { %W(-XX:MaxMetaspaceSize=#{v}) }, 'permgen' => ->(v) { %W(-XX:MaxPermSize=#{v} -XX:PermSize=#{v}) }, 'stack' => ->(v) { %W(-Xss#{v}) } }