Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issue #153] update commandline samples to use … #156

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,36 @@ Without any options, this tool silently records file open/close operations and u

[source,sh]
----
$ java -javaagent:path/to/file-leak-detector.jar ...your usual Java arguments follow...
$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar ...your usual Java arguments follow...
----

There are several options you can pass to the agent.
For example, to dump the open file descriptors when the total number reaches 200, you can do the following:

[source,sh]
----
$ java -javaagent:path/to/file-leak-detector.jar=threshold=200 ...your usual Java arguments follow...
$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar=threshold=200 ...your usual Java arguments follow...
----

Continuous logging of every opened/closed file:

[source,sh]
----
$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar=trace=/path/to/logfile.txt ...your usual Java arguments follow...
----

Or to have it run a mini HTTP server so that you can access the information from your browser, do the following and open http://localhost:19999/:

[source,sh]
----
$ java -javaagent:path/to/file-leak-detector.jar=http=19999 ...your usual Java arguments follow...
$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar=http=19999 ...your usual Java arguments follow...
----

Use the help option to see the help screen for the complete list of options:

[source,sh]
----
$ java -javaagent:path/to/file-leak-detector.jar=help
$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar=help
----

== Attaching after JVM startup
Expand All @@ -57,7 +64,7 @@ Options can be specified in the second argument in the same format you do to the

[source,sh]
----
$ java -jar path/to/file-leak-detector.jar 1500 threshold=200,strong
$ java -jar path/to/file-leak-detector-jar-with-dependencies.jar 1500 threshold=200,strong
----

== Supported options
Expand Down