Skip to content

Commit 3b4c99d

Browse files
author
Glyn Normington
committed
Clarify meaing of total available memory
Also note the effect of scaling an application. [#60311680]
1 parent e7d4e53 commit 3b4c99d

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ To use this buildpack specify the URI of the repository when pushing an applicat
1010

1111
cf push --buildpack https://github.com/cloudfoundry/java-buildpack
1212

13+
The total amount of memory available is specified when the application is pushed. See [Memory](docs/jre-openjdk.md#Memory) for information on how this determines the memory available to a Java application.
14+
1315
## Configuration and Extension
1416
The buildpack supports configuration and extension through the use of Git repository forking. The easiest way to accomplish this is to use [GitHub's forking functionality][] to create a copy of this repository. Make the required configuration and extension changes in the copy of the repository. Then specify the URL of the new repository when pushing Cloud Foundry applications. If the modifications are generally applicable to the Cloud Foundry community, please submit a [pull request][] with the changes.
1517

docs/jre-openjdk.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ The JRE can be configured by modifying the [`config/openjdk.yml`][] file. The J
2020
| ---- | -----------
2121
| `repository_root` | The URL of the OpenJDK repository index ([details][repositories]).
2222
| `version` | The version of Java runtime to use. Candidate versions can be found in the listings for [centos6][], [lucid][], [mountainlion][], and [precise][]. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`.
23-
| `memory_sizes` | Optional memory sizes, described below under "Memory".
24-
| `memory_heuristics` | Default memory size weightings, described below under "Default Memory Sizes".
23+
| `memory_sizes` | Optional memory sizes, described below under "Memory Sizes".
24+
| `memory_heuristics` | Default memory size weightings, described below under "Memory Weightings.
2525

2626
### Memory
2727

28+
The total available memory is specified when an application is pushed. The Java buildpack uses this value to control the JRE's use of various regions of memory. The JRE memory settings can be influenced by configuring the `memory_sizes` and/or `memory_heuristics` mappings.
29+
30+
Note: if the total available memory is scaled up or down, the Java buildpack does not re-calculate the JRE memory settings until the next time the appication is pushed.
31+
32+
#### Memory Sizes
33+
2834
The following optional properties may be specified in the `memory_sizes` mapping.
2935

3036
| Name | Description
@@ -35,8 +41,6 @@ The following optional properties may be specified in the `memory_sizes` mapping
3541
| `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`.
3642
| `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.
3743

38-
#### Memory Sizes and Ranges
39-
4044
Memory sizes together with _memory weightings_ (described in the next section) are used to calculate the amount of memory for each memory type. The calculation is described later.
4145

4246
Memory sizes consist of a non-negative integer followed by a unit (`k` for kilobytes, `m` for megabytes, `g` for gigabytes; the case is not significant). Only the memory size `0` may be specified without a unit.

0 commit comments

Comments
 (0)