{"id":17306113,"url":"https://github.com/andreastu/jctrace","last_synced_at":"2025-09-02T00:33:27.989Z","repository":{"id":174723765,"uuid":"102190573","full_name":"AndreasTu/jctrace","owner":"AndreasTu","description":"Java Concurrency Tracer","archived":false,"fork":false,"pushed_at":"2023-06-16T11:26:02.000Z","size":1440,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T23:33:16.618Z","etag":null,"topics":["asm","concurrent-programming","deadlock","instrumentation","java","trace"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndreasTu.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-09-02T10:59:01.000Z","updated_at":"2023-07-18T09:08:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"f572db0c-d26e-4ac5-a878-0009a12b5761","html_url":"https://github.com/AndreasTu/jctrace","commit_stats":null,"previous_names":["andreastu/jctrace"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndreasTu/jctrace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreasTu%2Fjctrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreasTu%2Fjctrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreasTu%2Fjctrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreasTu%2Fjctrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreasTu","download_url":"https://codeload.github.com/AndreasTu/jctrace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreasTu%2Fjctrace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273213867,"owners_count":25065058,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["asm","concurrent-programming","deadlock","instrumentation","java","trace"],"created_at":"2024-10-15T11:57:31.666Z","updated_at":"2025-09-02T00:33:27.974Z","avatar_url":"https://github.com/AndreasTu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JConcurrency Tracer (jctrace)\n\nThe JConcurrency Tracer allows you to find deadlocks in your Java application.\n\nThe JConcurrency Tracer instruments a Java application to find **potential** deadlocks in the system.\nJctrace will create a database of all taken and release locks in the application.\nIn a second step jctrace will calculate if any two locks have any threads, where the lock order is inverse, which will flag a potential deadlock.\n\n**Note:** Not every flagged potential deadlock, will be a real deadlock in your system. \nE.g. if you can guarantee that the found lock orders can not happen at the same time, the potential deadlock can not happen. \nBut it would be no good concurrency design to rely on these fragile terms.\n\n## Analysis details\n\nJctrace will instrument and measure the following items:\n* `synchronized` keyword\n  * For any `Object` or `Class` instance\n* `synchronized` methods\n* `java.util.concurrent.locks.ReentrantLock`\n* `java.util.concurrent.locks.ReentrantReadWriteLock`\n* `java.util.concurrent.locks.StampedLock`\n\nThe jctrace is currently only tested with Java 8 and Java 11.\n\nJctrace could also create stack traces of found potential deadlocks to ease the fix of the underlying problem.\n\n##  How to build jctrace?\nTo build the project just run:\n```\ngradlew shadowJar\n```\n\nThe built jar file it then located in `subprojects/jctrace-core/build/libs/jctrace-core-1.0.0-SNAPSHOT-all.jar\n\n## Create a measurement\n\nFirst you have to create a measurement of your running application.\n\nStart your application with the following additional Java-VM arguments:\n```\n-javaagent:jctrace-core-1.0.0-SNAPSHOT-all.jar\n-Xbootclasspath/a:jctrace-core-1.0.0-SNAPSHOT-all.jar\n-Dde.turban.DeadLockTracer.blacklist=org.eclipse;com.google\n-Dde.turban.DeadLockTracer.stacktracingClasses=\u003cClassName\u003e;\u003cSecondClassName\u003e\n```\n\nYou could blacklist whole packages including all sub packages with `-Dde.turban.DeadLockTracer.blacklist=`.\n\nPackages are separated with an `;`.\n\n#### Stacktrace\n\nYou could enable the collection of stack traces for certain classes with `-Dde.turban.DeadLockTracer.stacktracingClasses`\n\nClass names are separated with an `;`.\n \n\n##### Full sample\n\nFull Path sample:\n```\n-javaagent:/Path/To/Jar/File/jctrace-core-1.0.0-SNAPSHOT-all.jar\n-Xbootclasspath/a:/Path/To/Jar/File/jctrace-core-1.0.0-SNAPSHOT-all.jar\n\n-Dde.turban.DeadLockTracer.blacklist=org.eclipse;com.google;org.apache;java;sun;org.osgi;com.sun;org.codehaus.groovy;groovy\n\n-Dde.turban.DeadLockTracer.stacktracingClasses=pkg.to.class.ClassNameA;pkg.to.other.class.ClassB\n\n-Djava.util.logging.config.file=/Your/path/to/logging.properties\n```\n\n\n## Open UI to evaluate the Database\n\nYou could open the UI with:\n```\ngradlew run -PdbFile=Deadlock.db\n```\n\nNote: In the current version the UI will the show anything, if there is no potential deadlock.\n\n## Create a report \n\nOr you could create an XML report from the Database, if you call:\n```\ngradlew runReportXml -PdbFile=Deadlock.db -PreportFile=DeadlockReport.xml \n```\n\n\n## Further work to do (wish list)\n\n* Improve the usability of the UI\n * Make the Load/Close buttons work correctly\n * Display text, if not potential deadlock was found\n* Improve the usability of measurement creation with a wrapper which calls the java application\n* Add instrumentation for volatile field reads and writes to detect data races\n* Add instrumentation for Atomic* classes reads and writes to detect data races\n\n\n## Contributors\n\n* Creator:\n  * Andreas Turban (GitHub: AndreasTu)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreastu%2Fjctrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreastu%2Fjctrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreastu%2Fjctrace/lists"}