You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/framework-java_opts.md
+42-3Lines changed: 42 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,9 @@ The framework can be configured by creating or modifying the [`config/java_opts.
23
23
| Name | Description
24
24
| ---- | -----------
25
25
| `from_environment` | Whether to append the value of the `JAVA_OPTS` environment variable to the collection of Java options
26
-
| `java_opts` | The Java options to use when running the application. All values are used without modification when invoking the JVM. The options are specified as a single YAML scalar in plain style or enclosed in single or double quotes.
26
+
| `java_opts` | The Java options to use when running the application. All values are used without modification when invoking the JVM. The options are specified as a single YAML scalar in plain style or enclosed in single or double quotes.
27
27
28
-
Any `JAVA_OPTS` from either the config file or environment variables that configure memory options will cause deployment to fail as they're not allowed. Memory options are configured by the buildpack and may not be modified.
28
+
Any `JAVA_OPTS` from either the config file or environment variables that configure memory options will cause deployment to fail as they're not allowed. Memory options are configured by the buildpack and may not be modified.
29
29
30
30
## Example
31
31
```yaml
@@ -35,5 +35,44 @@ from_environment: false
35
35
java_opts: -Xloggc:$PWD/beacon_gc.log -verbose:gc
36
36
```
37
37
38
-
[Configuration and Extension]: ../README.md#configuration-and-extension
38
+
## Memory Settings
39
+
40
+
The following `JAVA_OPTS` are restricted and will cause the application to fail deployment.
41
+
42
+
* `-Xms`
43
+
* `-Xmx`
44
+
* `-Xss`
45
+
* `-XX:MaxMetaspaceSize`
46
+
* `-XX:MaxPermSize`
47
+
* `-XX:MetaspaceSize`
48
+
* `-XX:PermSize`
49
+
50
+
### Allowed Memory Settings
51
+
52
+
Setting any of the allowed memory settings may require a change to the [Memory Weightings]. Where a value is shown it is the default value for that setting.
53
+
54
+
| Argument| Description
55
+
| ------- | -----------
56
+
| `-Xmn <SIZE>` | Maximum size of young generation, known as the eden region. **This could effect the total heap size [Memory Weightings].**
57
+
| `-XX:+UseGCOverheadLimit` | Use a policy that limits the proportion of the VM's time that is spent in GC before an `java.lang.OutOfMemoryError` error is thrown.
58
+
| `-XX:+UseLargePages` | Use large page memory. For details, see [Java Support for Large Memory Pages].
59
+
| `-XX:-HeapDumpOnOutOfMemoryError` | Dump heap to file when `java.lang.OutOfMemoryError` is thrown.
60
+
| `-XX:HeapDumpPath=<PATH>` | Path to directory or filename for heap dump.
61
+
| `-XX:LargePageSizeInBytes=<SIZE>` | Sets the large page size used for the Java heap.
62
+
| `-XX:MaxDirectMemorySize=<SIZE>` | Upper limit on the maximum amount of allocatable direct buffer memory. **This could effect the [Memory Weightings].**
63
+
| `-XX:MaxHeapFreeRatio=<RATIO>` | Maximum percentage of heap free after GC to avoid shrinking.
64
+
| `-XX:MaxNewSize=<SIZE>` | Maximum size of new generation. Since `1.4`, `MaxNewSize` is computed as a function of `NewRatio`. **This could effect the total heap size [Memory Weightings].**
65
+
| `-XX:MinHeapFreeRatio=<RATIO>` | Minimum percentage of heap free after GC to avoid expansion.
66
+
| `-XX:NewRatio=<RATIO>` | Ratio of old/new generation sizes. 2 is equal to approximately 66%.
67
+
| `-XX:NewSize=<SIZE>` | Default size of new generation. **This could effect the total heap size [Memory Weightings].**
68
+
| `-XX:OnError="<CMD ARGS>;<CMD ARGS>"` | Run user-defined commands on fatal error.
69
+
| `-XX:OnOutOfMemoryError="<CMD ARGS>;<CMD ARGS>"` | Run user-defined commands when an `java.lang.OutOfMemoryError` is first thrown.
70
+
| `-XX:ReservedCodeCacheSize=<SIZE>` | _Java 8 Only_ Maximum code cache size. Also know as `-Xmaxjitcodesize`. **This could effect the [Memory Weightings].**
71
+
| `-XX:SurvivorRatio=<RATIO>` | Ratio of eden/survivor space. Solaris only.
72
+
| `-XX:TargetSurvivorRatio=<RATIO>` | Desired ratio of survivor space used after scavenge.
73
+
| `-XX:ThreadStackSize=<SIZE>` | Thread stack size. (0 means use default stack size).
74
+
39
75
[`config/java_opts.yml`]: ../config/java_opts.yml
76
+
[Configuration and Extension]: ../README.md#configuration-and-extension
77
+
[Java Support for Large Memory Pages]: http://www.oracle.com/technetwork/java/javase/tech/largememory-jsp-137182.html
0 commit comments