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
This change adds support for configuring the jvmkill agent to create terminal
heap dumps into volume services with a name, label, or tag containing heap-
dump. If that service does not exist, the agent continues to print the heap
histogram to the console.
[resolvescloudfoundry#439]
Copy file name to clipboardExpand all lines: docs/jre-open_jdk_jre.md
+50-6Lines changed: 50 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,15 @@ The OpenJDK JRE provides Java runtimes from the [OpenJDK][] project. Versions o
4
4
<table>
5
5
<tr>
6
6
<td><strong>Detection Criterion</strong></td>
7
-
<td>Unconditional</td>
7
+
<td>Unconditional. Existence of a single bound Volume Service will result in Terminal heap dumps being written.
8
+
<ul>
9
+
<li>Existence of a Volume Service service is defined as the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service who's name, label or tag has <code>heap-dump</code> as a substring.</li>
Tags are printed to standard output by the buildpack detect script
@@ -20,9 +24,11 @@ The JRE can be configured by modifying the [`config/open_jdk_jre.yml`][] file in
20
24
21
25
| Name | Description
22
26
| ---- | -----------
27
+
| `jre.repository_root` | The URL of the OpenJDK repository index ([details][repositories]).
28
+
| `jre.version` | The version of Java runtime to use. Candidate versions can be found in the listings for [mountainlion][] and [trusty][]. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`.
29
+
| `jvmkill.repository_root` | The URL of the `jvmkill` repository index ([details][repositories]).
30
+
| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [mountainlion][jvmkill-mountainlion] and [trusty][jvmkill-trusty].
23
31
| `memory_calculator` | Memory calculator defaults, described below under "Memory".
24
-
| `repository_root` | The URL of the OpenJDK repository index ([details][repositories]).
25
-
| `version` | The version of Java runtime to use. Candidate versions can be found in the listings for [mountainlion][], [precise][], and [trusty][]. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`.
26
32
27
33
### Additional Resources
28
34
The JRE can also be configured by overlaying a set of resources on the default distribution. To do this, add files to the `resources/open_jdk_jre` directory in the buildpack fork.
@@ -33,6 +39,42 @@ To add the JCE Unlimited Strength `local_policy.jar`, add your file to `resource
33
39
#### Custom CA Certificates
34
40
To add custom SSL certificates, add your `cacerts` file to `resources/open_jdk_jre/lib/security/cacerts`. This file will be overlayed onto the OpenJDK distribution.
35
41
42
+
### `jvmkill`
43
+
The `jvmkill` agent runs when an application has experience a resource exhaustion event. When this event occurs, the agent will print out a histogram of the first 100 largest types by total number of bytes.
44
+
45
+
```plain
46
+
Resource exhaustion event: the JVM was unable to allocate memory from the heap.
It will also print out a summary of all of the memory spaces in the JVM.
58
+
59
+
```plain
60
+
Memory usage:
61
+
Heap memory: init 65011712, used 332392888, committed 351797248, max 351797248
62
+
Non-heap memory: init 2555904, used 63098592, committed 64815104, max 377790464
63
+
Memory pool usage:
64
+
Code Cache: init 2555904, used 14702208, committed 15007744, max 251658240
65
+
PS Eden Space: init 16252928, used 84934656, committed 84934656, max 84934656
66
+
PS Survivor Space: init 2621440, used 0, committed 19398656, max 19398656
67
+
Compressed Class Space: init 0, used 5249512, committed 5505024, max 19214336
68
+
Metaspace: init 0, used 43150616, committed 44302336, max 106917888
69
+
PS Old Gen: init 43515904, used 247459792, committed 247463936, max 247463936
70
+
```
71
+
72
+
If a heap dump [Volume Service][] is bound, terminal heap dumps will be written with the pattern `"<CONTAINER_DIR>/<SPACE_NAME>-<SPACE_ID>/<APPLICATION_NAME>-<APPLICATION_ID>/<INSTANCE_INDEX>-<TIMESTAMP>-<INSTANCE_ID>.hprof`
73
+
74
+
```plain
75
+
Heapdump written to /var/vcap/data/9ae0b817-1446-4915-9990-74c1bb26f147/pcfdev-space-e91c5c39-b546-41d9-8095-9a45fa65df9e/java-main-application-892f20ab-9a53-441d-be3e-72c38f2a1055/0-2017-06-13T18:31:29+0000-7b23124e-7f0f-4a08-457b-60802d0a7326.hprof
76
+
```
77
+
36
78
### Memory
37
79
The total available memory for the application's container is specified when an application is pushed.
38
80
The Java buildpack uses this value to control the JRE's use of various
@@ -84,7 +126,7 @@ The container's total available memory is allocated into heap, metaspace and com
84
126
direct memory, and stack memory settings.
85
127
86
128
The memory calculation is described in more detail in the [Memory Calculator's README].
87
-
129
+
88
130
The inputs to the memory calculation, except the container's total memory (which is unknown at staging time), are logged during staging, for example:
Copy file name to clipboardExpand all lines: docs/jre-oracle_jre.md
+50-5Lines changed: 50 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,15 @@ The Oracle JRE provides Java runtimes from [Oracle][] project. No versions of t
4
4
<table>
5
5
<tr>
6
6
<td><strong>Detection Criterion</strong></td>
7
-
<td>Unconditional</td>
7
+
<td>Unconditional. Existence of a single bound Volume Service will result in Terminal heap dumps being written.
8
+
<ul>
9
+
<li>Existence of a Volume Service service is defined as the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service who's name, label or tag has <code>heap-dump</code> as a substring.</li>
Tags are printed to standard output by the buildpack detect script
@@ -36,9 +40,11 @@ To use Oracle JRE instead of OpenJDK without forking java-buildpack, set environ
36
40
37
41
| Name | Description
38
42
| ---- | -----------
43
+
| `jre.repository_root` | The URL of the Oracle repository index ([details][repositories]).
44
+
| `jre.version` | The version of Java runtime to use. Candidate versions can be found in the the repository that you have created to house the JREs. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`.
45
+
| `jvmkill.repository_root` | The URL of the `jvmkill` repository index ([details][repositories]).
46
+
| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [mountainlion][jvmkill-mountainlion] and [trusty][jvmkill-trusty].
39
47
| `memory_calculator` | Memory calculator defaults, described below under "Memory".
40
-
| `repository_root` | The URL of the Oracle repository index ([details][repositories]).
41
-
| `version` | The version of Java runtime to use. Candidate versions can be found in the the repository that you have created to house the JREs. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`.
42
48
43
49
### Additional Resources
44
50
The JRE can also be configured by overlaying a set of resources on the default distribution. To do this, add files to the `resources/oracle_jre` directory in the buildpack fork.
@@ -49,6 +55,42 @@ To add the JCE Unlimited Strength `local_policy.jar`, add your file to `resource
49
55
#### Custom CA Certificates
50
56
To add custom SSL certificates, add your `cacerts` file to `resources/oracle_jre/lib/security/cacerts`. This file will be overlayed onto the Oracle distribution.
51
57
58
+
### `jvmkill`
59
+
The `jvmkill` agent runs when an application has experience a resource exhaustion event. When this event occurs, the agent will print out a histogram of the first 100 largest types by total number of bytes.
60
+
61
+
```plain
62
+
Resource exhaustion event: the JVM was unable to allocate memory from the heap.
It will also print out a summary of all of the memory spaces in the JVM.
74
+
75
+
```plain
76
+
Memory usage:
77
+
Heap memory: init 65011712, used 332392888, committed 351797248, max 351797248
78
+
Non-heap memory: init 2555904, used 63098592, committed 64815104, max 377790464
79
+
Memory pool usage:
80
+
Code Cache: init 2555904, used 14702208, committed 15007744, max 251658240
81
+
PS Eden Space: init 16252928, used 84934656, committed 84934656, max 84934656
82
+
PS Survivor Space: init 2621440, used 0, committed 19398656, max 19398656
83
+
Compressed Class Space: init 0, used 5249512, committed 5505024, max 19214336
84
+
Metaspace: init 0, used 43150616, committed 44302336, max 106917888
85
+
PS Old Gen: init 43515904, used 247459792, committed 247463936, max 247463936
86
+
```
87
+
88
+
If a heap dump [Volume Service][] is bound, terminal heap dumps will be written with the pattern `"<CONTAINER_DIR>/<SPACE_NAME>-<SPACE_ID>/<APPLICATION_NAME>-<APPLICATION_ID>/<INSTANCE_INDEX>-<TIMESTAMP>-<INSTANCE_ID>.hprof`
89
+
90
+
```plain
91
+
Heapdump written to /var/vcap/data/9ae0b817-1446-4915-9990-74c1bb26f147/pcfdev-space-e91c5c39-b546-41d9-8095-9a45fa65df9e/java-main-application-892f20ab-9a53-441d-be3e-72c38f2a1055/0-2017-06-13T18:31:29+0000-7b23124e-7f0f-4a08-457b-60802d0a7326.hprof
92
+
```
93
+
52
94
### Memory
53
95
The total available memory for the application's container is specified when an application is pushed.
54
96
The Java buildpack uses this value to control the JRE's use of various
@@ -100,7 +142,7 @@ The container's total available memory is allocated into heap, metaspace and com
100
142
direct memory, and stack memory settings.
101
143
102
144
The memory calculation is described in more detail in the [Memory Calculator's README].
103
-
145
+
104
146
The inputs to the memory calculation, except the container's total memory (which is unknown at staging time), are logged during staging, for example:
Copy file name to clipboardExpand all lines: docs/jre-zulu_jre.md
+52-7Lines changed: 52 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,15 @@ Azul Zulu JRE provides Java runtimes developed by Azul team. Versions of Java f
4
4
<table>
5
5
<tr>
6
6
<td><strong>Detection Criterion</strong></td>
7
-
<td>Unconditional</td>
7
+
<td>Unconditional. Existence of a single bound Volume Service will result in Terminal heap dumps being written.
8
+
<ul>
9
+
<li>Existence of a Volume Service service is defined as the <a href="http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#VCAP-SERVICES"><code>VCAP_SERVICES</code></a> payload containing a service who's name, label or tag has <code>heap-dump</code> as a substring.</li>
Tags are printed to standard output by the buildpack detect script.
@@ -27,9 +31,11 @@ To use Zulu JRE instead of OpenJDK without forking java-buildpack, set environme
27
31
28
32
| Name | Description
29
33
| ---- | -----------
34
+
| `jre.repository_root` | The URL of the Zulu repository index ([details][repositories]).
35
+
| `jre.version` | The version of Java runtime to use. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`.
36
+
| `jvmkill.repository_root` | The URL of the `jvmkill` repository index ([details][repositories]).
37
+
| `jvmkill.version` | The version of `jvmkill` to use. Candidate versions can be found in the listings for [mountainlion][jvmkill-mountainlion] and [trusty][jvmkill-trusty].
30
38
| `memory_calculator` | Memory calculator defaults, described below under "Memory".
31
-
| `repository_root` | The URL of the Zulu repository index ([details][repositories]).
32
-
| `version` | The version of Java runtime to use. Note: version 1.8.0 and higher require the `memory_sizes` and `memory_heuristics` mappings to specify `metaspace` rather than `permgen`.
33
39
34
40
### Additional Resources
35
41
The JRE can also be configured by overlaying a set of resources on the default distribution. To do this, add files to the `resources/zulu_jre` directory in the buildpack fork.
@@ -40,6 +46,42 @@ To add the JCE Unlimited Strength `local_policy.jar`, add your file to `resource
40
46
#### Custom CA Certificates
41
47
To add custom SSL certificates, add your `cacerts` file to `resources/zulu_jre/lib/security/cacerts`. This file will be overlayed onto the Zulu distribution.
42
48
49
+
### `jvmkill`
50
+
The `jvmkill` agent runs when an application has experience a resource exhaustion event. When this event occurs, the agent will print out a histogram of the first 100 largest types by total number of bytes.
51
+
52
+
```plain
53
+
Resource exhaustion event: the JVM was unable to allocate memory from the heap.
It will also print out a summary of all of the memory spaces in the JVM.
65
+
66
+
```plain
67
+
Memory usage:
68
+
Heap memory: init 65011712, used 332392888, committed 351797248, max 351797248
69
+
Non-heap memory: init 2555904, used 63098592, committed 64815104, max 377790464
70
+
Memory pool usage:
71
+
Code Cache: init 2555904, used 14702208, committed 15007744, max 251658240
72
+
PS Eden Space: init 16252928, used 84934656, committed 84934656, max 84934656
73
+
PS Survivor Space: init 2621440, used 0, committed 19398656, max 19398656
74
+
Compressed Class Space: init 0, used 5249512, committed 5505024, max 19214336
75
+
Metaspace: init 0, used 43150616, committed 44302336, max 106917888
76
+
PS Old Gen: init 43515904, used 247459792, committed 247463936, max 247463936
77
+
```
78
+
79
+
If a heap dump [Volume Service][] is bound, terminal heap dumps will be written with the pattern `"<CONTAINER_DIR>/<SPACE_NAME>-<SPACE_ID>/<APPLICATION_NAME>-<APPLICATION_ID>/<INSTANCE_INDEX>-<TIMESTAMP>-<INSTANCE_ID>.hprof`
80
+
81
+
```plain
82
+
Heapdump written to /var/vcap/data/9ae0b817-1446-4915-9990-74c1bb26f147/pcfdev-space-e91c5c39-b546-41d9-8095-9a45fa65df9e/java-main-application-892f20ab-9a53-441d-be3e-72c38f2a1055/0-2017-06-13T18:31:29+0000-7b23124e-7f0f-4a08-457b-60802d0a7326.hprof
83
+
```
84
+
43
85
### Memory
44
86
The total available memory for the application's container is specified when an application is pushed.
45
87
The Java buildpack uses this value to control the JRE's use of various
@@ -91,7 +133,7 @@ The container's total available memory is allocated into heap, metaspace and com
91
133
direct memory, and stack memory settings.
92
134
93
135
The memory calculation is described in more detail in the [Memory Calculator's README].
94
-
136
+
95
137
The inputs to the memory calculation, except the container's total memory (which is unknown at staging time), are logged during staging, for example:
0 commit comments