@@ -15,11 +15,14 @@ Currently, it allows you to:
1515 ([ SapMachine] ( https://sapmachine.io ) only) profiles
1616- Run [ jstall] ( https://github.com/parttimenerd/jstall ) for one-shot JVM inspection (deadlock detection, hot threads,
1717 dependency graphs, and more): bundled directly in the plugin, requires Java 17+ locally
18- - Redact heap dumps before saving to remove sensitive data (` --redact ` , ` --redact-complete ` )
18+ - Redact heap dumps before saving to remove sensitive data (` --redact ` , ` --redact-complete ` ) using the bundled
19+ [ ` hprof-redact ` ] ( https://github.com/parttimenerd/hprof-analyzer ) binary from the
20+ [ ` hprof-analyzer ` ] ( https://github.com/parttimenerd/hprof-analyzer ) project
1921- Automatically compress heap dump transfers over SSH on JDK 17+ containers;
2022 use ` --compress ` to keep the local file as ` .hprof.gz `
21- - Open heap dumps directly in the [ hprof-analyzer] ( https://parttimenerd.github.io/hprof-analyzer ) web app
22- after downloading (` --open ` )
23+ - Open heap dumps directly in the hosted
24+ [ ` hprof-analyzer ` ] ( https://parttimenerd.github.io/hprof-analyzer ) web app after downloading (` --open ` ) or point the
25+ plugin at another ` hprof-analyzer ` instance via ` --open-url `
2326
2427## Installation
2528
@@ -44,16 +47,18 @@ Download the latest release from [GitHub](https://github.com/SAP/cf-cli-java-plu
4447To install a new version of the plugin, run the following:
4548
4649``` sh
47- # on Mac arm64
50+ # on Mac arm64 (Apple Silicon only)
4851cf install-plugin https://github.com/SAP/cf-cli-java-plugin/releases/latest/download/cf-cli-java-plugin-macos-arm64
49- # on Windows x64
52+ # on Windows amd64
5053cf install-plugin https://github.com/SAP/cf-cli-java-plugin/releases/latest/download/cf-cli-java-plugin-windows-amd64
51- # on Linux x64
54+ # on Linux amd64
5255cf install-plugin https://github.com/SAP/cf-cli-java-plugin/releases/latest/download/cf-cli-java-plugin-linux-amd64
5356# on Linux arm64
5457cf install-plugin https://github.com/SAP/cf-cli-java-plugin/releases/latest/download/cf-cli-java-plugin-linux-arm64
5558```
5659
60+ macOS plugin binaries currently require Apple Silicon; macOS Intel (` darwin/amd64 ` ) is not supported.
61+
5762You can verify that the plugin is successfully installed by looking for ` java ` in the output of ` cf plugins ` .
5863
5964### Manual Installation of Snapshot Release
@@ -64,16 +69,18 @@ This is intended for experimentation and might fail.
6469To install a new version of the plugin, run the following:
6570
6671``` sh
67- # on Mac arm64
72+ # on Mac arm64 (Apple Silicon only)
6873cf install-plugin https://github.com/SAP/cf-cli-java-plugin/releases/download/snapshot/cf-cli-java-plugin-macos-arm64
69- # on Windows x64
74+ # on Windows amd64
7075cf install-plugin https://github.com/SAP/cf-cli-java-plugin/releases/download/snapshot/cf-cli-java-plugin-windows-amd64
71- # on Linux x64
76+ # on Linux amd64
7277cf install-plugin https://github.com/SAP/cf-cli-java-plugin/releases/download/snapshot/cf-cli-java-plugin-linux-amd64
7378# on Linux arm64
7479cf install-plugin https://github.com/SAP/cf-cli-java-plugin/releases/download/snapshot/cf-cli-java-plugin-linux-arm64
7580```
7681
82+ macOS snapshot binaries currently require Apple Silicon; macOS Intel (` darwin/amd64 ` ) is not supported.
83+
7784## Common Tasks
7885
7986### My CF app is not responding — find what it is stuck on
@@ -224,10 +231,15 @@ cf java heap-dump $APP_NAME --open --redact --compress
224231cf java heap-dump $APP_NAME --open-url http://localhost:8080
225232` ` `
226233
234+ The browser integration uses the [`hprof-analyzer`](https://github.com/parttimenerd/hprof-analyzer) project. By
235+ default, `--open` launches the hosted web app at <https://parttimenerd.github.io/hprof-analyzer>. Use `--open-url` if
236+ you run your own local or internal `hprof-analyzer` deployment.
237+
227238> **macOS note:** On macOS with the Application Firewall enabled, a dialog will appear asking
228239> *"Do you want the application 'cf-cli-java-plugin' to accept incoming network connections?"*
229240> Click **Allow** — the plugin binds a temporary local server on `127.0.0.1` to serve the file
230- > to the browser. The server shuts down automatically after the browser fetches the file once.
241+ > to the browser. The server serves only the exact one-time heap-dump URL generated for that download,
242+ > rejects alternate paths or query parameters, and shuts down automatically after one successful fetch.
231243
232244Getting a thread dump :
233245
@@ -359,6 +371,22 @@ cf java thread-dump [my_app] -i [my_instance_index] > thread-dump.txt
359371
360372The `--keep` flag is not applicable to commands that stream output directly (e.g., `thread-dump`).
361373
374+ Heap dumps support additional local post-processing and analysis options :
375+
376+ - `--redact` : lean redaction mode; streams the heap dump through `hprof-redact` and zeros primitive arrays such as
377+ ` byte[]` , `char[]`, and similar bulk buffers
378+ - `--redact-complete` : complete redaction mode; streams the heap dump through `hprof-redact` and zeros primitive arrays
379+ and individual primitive fields
380+ - `--redact-keep-on-error` : keeps a partially written redacted output file if local redaction fails; otherwise failed
381+ redaction leaves no local heap dump behind
382+ - `--compress` : keeps the local output as `.hprof.gz` instead of transparently decompressing it
383+ - `--open` : starts a temporary local HTTP server on `127.0.0.1`, serves the downloaded heap dump once, and opens
384+ [`hprof-analyzer`](https://parttimenerd.github.io/hprof-analyzer) automatically in your browser
385+ - `--open-url <URL>` : same as `--open`, but targets a custom hosted or self-managed `hprof-analyzer` instance
386+
387+ These features can be combined, for example : ` cf java heap-dump APP --redact --compress --open` .
388+ ` --open` requires a local file and therefore cannot be used with `--no-download`.
389+
362390# ## Heap Dump Privacy
363391
364392Heap dumps contain the full in-memory state of a JVM, including strings, byte arrays, and field values, which can
@@ -373,11 +401,14 @@ use `--redact` or `--redact-complete` to zero out sensitive values.
373401Both modes preserve the full object graph (class names, references, instance counts), so the dump remains useful for
374402memory analysis. The two flags are mutually exclusive.
375403
376- The redacted file is saved locally with a `-redacted` suffix; the original unredacted file is deleted automatically.
404+ The redacted file is saved to the requested local heap-dump path with no extra suffix. When redaction is enabled, the
405+ heap dump is streamed directly into `hprof-redact` exactly as downloaded, including gzip-compressed `.hprof.gz`
406+ streams, so the unredacted dump is never written to local disk.
377407Use `--redact --compress` to also compress the output (produces a `.hprof.gz`).
378408
379- Redaction runs locally via the bundled [hprof-redact](https://github.com/parttimenerd/hprof-analyzer) binary after
380- the dump is downloaded. Supported platforms : Linux (x86_64, arm64), macOS (Apple Silicon), Windows (x86_64, arm64).
409+ Redaction runs locally via the bundled [hprof-redact](https://github.com/parttimenerd/hprof-analyzer) binary while the
410+ dump is being downloaded. The binary is embedded from the
411+ [`hprof-analyzer`](https://github.com/parttimenerd/hprof-analyzer) project, so no separate installation is required.
381412
382413# ## Compressed Transfer
383414
@@ -391,6 +422,17 @@ Without `--compress`, the plugin still uses `gz=1` automatically when the remote
391422compressed but the local file is transparently decompressed to a plain `.hprof`. This is the default behaviour
392423starting from JDK 17 and costs nothing from the user's perspective.
393424
425+ # ## Opening a Heap Dump in hprof-analyzer
426+
427+ Use `--open` to inspect the downloaded heap dump immediately in
428+ [`hprof-analyzer`](https://github.com/parttimenerd/hprof-analyzer), either via the hosted instance at
429+ <https://parttimenerd.github.io/hprof-analyzer> or via your own deployment with `--open-url`.
430+
431+ For safety, the plugin does **not** expose an arbitrary local directory. Instead, it starts a temporary local HTTP
432+ server bound to `127.0.0.1`, serves only the exact generated heap-dump for that one download, rejects alternate
433+ paths and query parameters, and shuts the server down automatically after one successful browser fetch or after a
434+ timeout if the browser never connects.
435+
394436# # Limitations
395437
396438Some commands depend on writable filesystem space inside the application container. In particular, `cf java heap-dump`,
0 commit comments