Skip to content

Commit fb75d64

Browse files
author
Glyn Normington
committed
Document OpenJDK memory size configuration
[#52140727]
1 parent 64afa98 commit fb75d64

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

docs/container-java-main.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ The Java Main Class Container allows applications that provide a class with a `m
33

44
<table>
55
<tr>
6-
<td><strong>Detection Criteria:</strong></td><td><tt>Main-Class</tt> attribute set in <tt>META-INF/MANIFEST.MF</tt> or <tt>java_main_class</tt> set</td>
6+
<td><strong>Detection Criteria</strong></td><td><tt>Main-Class</tt> attribute set in <tt>META-INF/MANIFEST.MF</tt> or <tt>java_main_class</tt> set</td>
77
</tr>
88
<tr>
9-
<td><strong>Tags:</strong></td><td><tt>java-main</tt></td>
9+
<td><strong>Tags</strong></td><td><tt>java-main</tt></td>
1010
</tr>
1111
</table>
1212
Tags are printed to standard output by the buildpack detect script

docs/container-tomcat.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ The Tomcat Container allows web application to be run. These applications are r
33

44
<table>
55
<tr>
6-
<td><strong>Detection Criterion:</strong></td><td>Existence of a <tt>WEB-INF/</tt> folder in the application directory</td>
6+
<td><strong>Detection Criterion</strong></td><td>Existence of a <tt>WEB-INF/</tt> folder in the application directory</td>
77
</tr>
88
<tr>
9-
<td><strong>Tags:</strong></td><td><tt>tomcat-&lang;version&rang;</tt></td>
9+
<td><strong>Tags</strong></td><td><tt>tomcat-&lang;version&rang;</tt></td>
1010
</tr>
1111
</table>
1212
Tags are printed to standard output by the buildpack detect script

docs/framework-java_opts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ The `JAVA_OPTS` Framework contributes arbitrary Java options to the application
33

44
<table>
55
<tr>
6-
<td><strong>Detection Criterion:</strong></td><td><ptt>java_opts</tt> set</td>
6+
<td><strong>Detection Criterion</strong></td><td><ptt>java_opts</tt> set</td>
77
</tr>
88
<tr>
9-
<td><strong>Tags:</strong></td><td><tt>java-opts</tt></td>
9+
<td><strong>Tags</strong></td><td><tt>java-opts</tt></td>
1010
</tr>
1111
</table>
1212
Tags are printed to standard output by the buildpack detect script

docs/jre-openjdk.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ The OpenJDK JRE provides Java runtimes from the [OpenJDK][openjdk] project. Ver
66

77
<table>
88
<tr>
9-
<td><strong>Detection Criterion:</strong></td><td>Unconditional</td>
9+
<td><strong>Detection Criterion</strong></td><td>Unconditional</td>
1010
</tr>
1111
<tr>
12-
<td><strong>Tags:</strong></td><td><tt>openjdk-&lang;version&rang;</tt></td>
12+
<td><strong>Tags</strong></td><td><tt>openjdk-&lang;version&rang;</tt></td>
1313
</tr>
1414
</table>
1515
Tags are printed to standard output by the buildpack detect script
@@ -29,21 +29,19 @@ The JRE can be configured by modifying the [`config/openjdk.yml`][openjdk_yml] f
2929

3030
### Memory
3131

32+
The following properties may be specified in [`config/openjdk.yml`][openjdk_yml].
33+
3234
| Name | Description
3335
| ---- | -----------
34-
| `java.heap.size` | The Java maximum heap size to use. For example, a value of `64m` will result in the java command line option `-Xmx64m`. Values containing whitespace are rejected with an error, but all others values appear without modification on the java command line appended to `-Xmx`.
35-
| `java.metaspace.size` | The Java maximum Metaspace size to use. This is applicable to versions of OpenJDK from 1.8 onwards. For example, a value of `128m` will result in the java command line option `-XX:MaxMetaspaceSize=128m`. Values containing whitespace are rejected with an error, but all others values appear without modification on the java command line appended to `-XX:MaxMetaspaceSize=`.
36-
| `java.permgen.size` | The Java maximum PermGen size to use. This is applicable to versions of OpenJDK earlier than 1.8. For example, a value of `128m` will result in the java command line option `-XX:MaxPermSize=128m`. Values containing whitespace are rejected with an error, but all others values appear without modification on the java command line appended to `-XX:MaxPermSize=`.
37-
| `java.stack.size` | The Java stack size to use. For example, a value of `256k` will result in the java command line option `-Xss256k`. Values containing whitespace are rejected with an error, but all others values appear without modification on the java command line appended to `-Xss`.
36+
| `heap` | The Java maximum heap size to use. For example, a value of `64m` will result in the java command line option `-Xmx64m`. Values containing whitespace are rejected with an error, but all others values appear without modification on the java command line appended to `-Xmx`.
37+
| `metaspace` | The Java maximum Metaspace size to use. This is applicable to versions of OpenJDK from 1.8 onwards. For example, a value of `128m` will result in the java command line option `-XX:MaxMetaspaceSize=128m`. Values containing whitespace are rejected with an error, but all others values appear without modification on the java command line appended to `-XX:MaxMetaspaceSize=`.
38+
| `permgen` | The Java maximum PermGen size to use. This is applicable to versions of OpenJDK earlier than 1.8. For example, a value of `128m` will result in the java command line option `-XX:MaxPermSize=128m`. Values containing whitespace are rejected with an error, but all others values appear without modification on the java command line appended to `-XX:MaxPermSize=`.
39+
| `stack` | The Java stack size to use. For example, a value of `256k` will result in the java command line option `-Xss256k`. Values containing whitespace are rejected with an error, but all others values appear without modification on the java command line appended to `-Xss`.
3840

3941
#### Default Memory Sizes
4042

4143
If some memory sizes are not specified using the above properties, default values are provided. For maximum heap, Metaspace, or PermGen size, the default value is based on a proportion of the total memory specified when the application was pushed. For stack size, the default value is one megabyte.
4244

4345
If any memory sizes are specified which are not equal to the default value, the proportionate defaults are adjusted accordingly. The default stack size is never adjusted from the default value.
4446

45-
#### OpenJDK Memory Heuristics
46-
47-
The calculation of default memory sizes for OpenJDK is configured via YAML files in the buildpack's `config` directory.
48-
49-
The configuration contains a weighting between `0` and `1` corresponding to a proportion of the total memory specified when the application was pushed. The weightings should add up to `1`.
47+
The default memory size proportions are configured in the `memory_heuristics` section of [`config/openjdk.yml`][openjdk_yml]. Each memory size is given a weighting between `0` and `1` corresponding to a proportion of the total memory specified when the application was pushed. The weightings should add up to `1`.

0 commit comments

Comments
 (0)