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: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,14 +21,18 @@ $ go get -v github.com/cloudfoundry/java-buildpack-memory-calculator
21
21
22
22
The following algorithm is used to generate the holistic JVM memory configuration:
23
23
24
-
1. Headroom is calculated as `total memory * (head room / 100)`
25
-
1. If `-XX:MaxDirectMemorySize` is configured it is used for the amount of direct memory. If not configured `10M` (in the absence of any reasonable heuristic) is used.
26
-
1. If `-XX:MaxMetaspaceSize` is configured it is used for the amount of metaspace. If not configured then the value is calculated as `(5800B * loaded class count) + 14000000b`.
27
-
1. If `-XX:ReservedCodeCacheSize` is configured it is used for the amount of reserved code cache. If not configured `240M` (the JVM default) is used.
28
-
1. If `-Xss` is configured it is used for the size of each thread stack. If not configured `1M` (the JVM default) is used.
29
-
1. If `-Xmx` is configured it is used for the size of the heap. If not configured then the value is calculated as `total memory - (headroom + direct memory + metaspace + reserved code cache + (thread stack * thread count))`.
30
-
31
-
Broadly, this means that for a constant application (same number of classes), the non-heap overhead is a fixed value. Any changes to the total memory will be directly reflected in the size of the heap. Adjustments to the non-heap memory configuration (e.g. stack size, reserved code cache) _can_ result in larger heap sizes but can also have negative runtime side-effects that must be taken into account.
24
+
1.`Headroom amount` is calculated as `total memory * (head room / 100)`.
25
+
1. If `-XX:MaxDirectMemorySize` is configured it is used for the amount of direct memory. If not configured, `10M` (in the absence of any reasonable heuristic) is used.
26
+
1. If `-XX:MaxMetaspaceSize` is configured it is used for the amount of metaspace. If not configured, then the value is calculated as `(5800B * loaded class count) + 14000000b`.
27
+
1. If `-XX:ReservedCodeCacheSize` is configured it is used for the amount of reserved code cache. If not configured, `240M` (the JVM default) is used.
28
+
1. If `-Xss` is configured it is used for the size of each thread stack. If not configured, `1M` (the JVM default) is used.
29
+
1. If `-Xmx` is configured it is used for the size of the heap. If not configured, then the value is calculated as
30
+
31
+
```
32
+
total memory - (headroom amount + direct memory + metaspace + reserved code cache + (thread stack * thread count))
33
+
```
34
+
35
+
Broadly, this means that for a constant application (same number of classes), the non-heap overhead is a fixed value. Any changes to the total memory will be directly reflected in the size of the heap. Adjustments to the non-heap memory configuration (e.g. stack size, reserved code cache) _can_ result in larger heap sizes, but can also have negative runtime side-effects that must be taken into account.
0 commit comments