|
7 | 7 | intentional presence of leaks and to check for unintended leaks. The main API entry points for
|
8 | 8 | this are `with-leak-collection`, `with-expected-leaks` and `instrument-tests!`.
|
9 | 9 |
|
10 |
| - To enable it, pass `-Dio.netty.customResourceLeakDetector=aleph.resource_leak_detector` to the |
11 |
| - JVM. You will also have to pass `-Dio.netty.leakDetection.level=PARANOID`. |
12 |
| -
|
13 |
| - Most reliable results are achieved by also passing the following options: |
14 |
| - `-Dio.netty.leakDetection.targetRecords=1` |
15 |
| - `-Dio.netty.allocator.type=unpooled` |
16 |
| -
|
17 |
| - All of the above is also provided by the `:leak-detection` Leiningen profile. |
| 10 | + To enable it, use the `:leak-detection` Leiningen profile. |
18 | 11 |
|
19 | 12 | NOTE: Currently only improves reliability for detecting leaked ByteBufs. Other types of leaked
|
20 | 13 | resources will still be detected but not with the same reliability. Search Netty's codebase for
|
|
58 | 51 | "Enable Netty debug logging to diagnose the cause.")))
|
59 | 52 | (throw (RuntimeException.
|
60 | 53 | (str "Attempted to use `aleph.resource-leak-detector` API but it is not enabled. "
|
61 |
| - "Pass `-Dio.netty.customResourceLeakDetector=aleph.resource_leak_detector` to enable."))))) |
| 54 | + "To enable it, use the `:leak-detection` Leiningen profile."))))) |
62 | 55 | (when-not (= ResourceLeakDetector$Level/PARANOID (ResourceLeakDetector/getLevel))
|
63 | 56 | (throw (RuntimeException.
|
64 | 57 | (str "`aleph.resource_leak_detector` requires `-Dio.netty.leakDetection.level=PARANOID`. "
|
|
205 | 198 | (alter-meta! tv update :test instrument-test-fn))))))
|
206 | 199 |
|
207 | 200 | (if (enabled?)
|
208 |
| - (log/info "enabled.") |
209 |
| - (log/info "disabled. This means resource leaks will be reported less accurately." |
210 |
| - "Pass `-Dio.netty.customResourceLeakDetector=aleph.resource_leak_detector` to enable.")) |
| 201 | + (log/info "aleph.resource-leak-detector enabled.") |
| 202 | + (log/info "aleph.resource-leak-detector disabled. This means resource leaks will be reported less accurately." |
| 203 | + "To enable it, use the `:leak-detection` Leiningen profile.")) |
0 commit comments