{"id":20316215,"url":"https://github.com/d0k1/openj9cmd","last_synced_at":"2025-03-04T09:13:59.049Z","repository":{"id":83452978,"uuid":"143681775","full_name":"d0k1/openj9cmd","owner":"d0k1","description":"OpenJ9 diagnostic tool","archived":false,"fork":false,"pushed_at":"2018-08-19T18:46:50.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T12:53:57.498Z","etag":null,"topics":["jcmd","jmap","jstack","openj9","serviceability"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d0k1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-06T05:46:17.000Z","updated_at":"2018-08-19T18:46:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e7796fd-be92-4f8e-b3ed-f8d76ce1aad6","html_url":"https://github.com/d0k1/openj9cmd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0k1%2Fopenj9cmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0k1%2Fopenj9cmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0k1%2Fopenj9cmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0k1%2Fopenj9cmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d0k1","download_url":"https://codeload.github.com/d0k1/openj9cmd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241818902,"owners_count":20025210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jcmd","jmap","jstack","openj9","serviceability"],"created_at":"2024-11-14T18:24:56.362Z","updated_at":"2025-03-04T09:13:59.028Z","avatar_url":"https://github.com/d0k1.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenJ9 Diagnostic tool\nOpenJ9 doesn't have any command line diagnostic utilities like jstack / jmap / jstat / jcmd.\nIt is because OpenJ9 does not have Attach API extensions as OpenJDK have at the moment.\nThis project demonstrates abilities of Attach API in OpenJ9 that are added with https://github.com/eclipse/openj9/issues/2543\n\n## Build\nYou need Eclipse OpenJ9 JDK and Apache Maven.\n\n* Define environmental variable `JAVA_HOME`. It must point to OpenJ9 jdk directory.\n* Run `mvn clean package`\nThat's it. `target` directory will contains `openj9cmd-1.0.jar`\n\n\n## Prepare\n\nYou cant wrap this tool into shell script, for example openj9cmd.sh\n\n`\n${JAVA_HOME}/bin/java -classpath ${JAVA_HOME}/jre/lib/charsets.jar:${JAVA_HOME}/jre/lib/ext/cldrdata.jar:${JAVA_HOME}/jre/lib/ext/dnsns.jar:${JAVA_HOME}/jre/lib/ext/dtfj.jar:${JAVA_HOME}/jre/lib/ext/dtfjview.jar:${JAVA_HOME}/jre/lib/ext/jaccess.jar:${JAVA_HOME}/jre/lib/ext/localedata.jar:${JAVA_HOME}/jre/lib/ext/nashorn.jar:${JAVA_HOME}/jre/lib/ext/sunec.jar:${JAVA_HOME}/jre/lib/ext/sunjce_provider.jar:${JAVA_HOME}/jre/lib/ext/sunpkcs11.jar:${JAVA_HOME}/jre/lib/ext/traceformat.jar:${JAVA_HOME}/jre/lib/ext/zipfs.jar:${JAVA_HOME}/jre/lib/jce.jar:${JAVA_HOME}/jre/lib/jsse.jar:${JAVA_HOME}/jre/lib/management-agent.jar:${JAVA_HOME}/jre/lib/resources.jar:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/tools.jar:./target/openj9cmd-1.0.jar com.focusit.openj9cmd \"$@\"\n`\n\nlater you can call it\n```\nbash ./openj9cmd.sh 31605 threaddump /tmp/threaddump\nbash ./openj9cmd.sh 31605 jstack true true jstack.txt\n```\n\n## Run\n\nThis tool provides just 3 basic functions. It can trigger OpenJ9 JavaDump and HeapDump, and it can get thread dump in jstack fashion.\n\n## JavaDump\n`bash ./openj9cmd.sh PID threaddump PATH/TO/FILE`\n\n- PID processId\n- PATH/TO/FILE file to hold all information\n\n### Tip\nIn my opinion, the best instrument to analyze that kind of dumps is IBM Thread and Monitor Dump Analyzer for Java (https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=2245aa39-fa5c-4475-b891-14c205f7333c)\n\n## HeapDump\n`bash ./openj9cmd.sh PID heapdump PATH/TO/FILE`\n\n- PID processId\n- PATH/TO/FILE file to hold all information\n\n### Tip\nHeap dump produced by this tool is in PHD (Portable Heap Dump) format. To analyze it you have to install DTJF(IBM Diagnostic Tool Framework for Java) into Eclipse Memory Analyzer\nEclipse download site can be found at https://developer.ibm.com/javasdk/tools/ (http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/runtimes/tools/dtfj/)\n\n## JStack\n`bash ./openj9cmd.sh PID jstack LockeMonitors LockedSynchronizers PATH/TO/FILE`\n\n- PID processId\n- LockeMonitors whether or not information on all currently locked object monitors is to be returned (as for ThreadMXBean's JavaDoc)\n- LockedSynchronizers of whether or not information on all currently locked ownable synchronizers is to be returned (as for ThreadMXBean's JavaDoc)\n- PATH/TO/FILE file to hold all information\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd0k1%2Fopenj9cmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd0k1%2Fopenj9cmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd0k1%2Fopenj9cmd/lists"}