{"id":20474208,"url":"https://github.com/marschall/exception-counter","last_synced_at":"2026-04-20T02:01:42.161Z","repository":{"id":20530506,"uuid":"23809683","full_name":"marschall/exception-counter","owner":"marschall","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-11T14:18:56.000Z","size":518,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-09T13:51:23.701Z","etag":null,"topics":[],"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/marschall.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}},"created_at":"2014-09-08T21:47:14.000Z","updated_at":"2022-03-31T20:50:43.000Z","dependencies_parsed_at":"2022-07-23T05:47:23.529Z","dependency_job_id":null,"html_url":"https://github.com/marschall/exception-counter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/marschall/exception-counter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fexception-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fexception-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fexception-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fexception-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marschall","download_url":"https://codeload.github.com/marschall/exception-counter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marschall%2Fexception-counter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32029857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":[],"created_at":"2024-11-15T14:28:36.122Z","updated_at":"2026-04-20T02:01:42.114Z","avatar_url":"https://github.com/marschall.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Exception Counter JVM Agent [![Build Status](https://travis-ci.org/marschall/exception-counter.svg?branch=master)](https://travis-ci.org/marschall/exception-counter)\n===========================\n\nA very simple JMTI agent that counts how many exceptions have occurred in a JVM.\n\nAlso contains an MBean that can be used for monitoring.\n\n\u003cimg src=\"https://raw.githubusercontent.com/marschall/exception-counter/master/src/doc/exception-count-2.png\" width=\"558\" height=\"350\" alt=\"VisualVM\"/\u003e\n\nHow do I run it?\n----------------\n\nAdding `-agentpath:/path/to/agent` is the simplest way to do it. To read the values the JAR has to be in the classpath as well.\n\nCan I attach at runtime?\n------------------------\n\nAttaching with JCMD is the simplest way to do it\n\n    jcmd pidOfProcessToAttachTo JVMTI.agent_load /path/to/agent\n\nTo read the values the JAR has to be in the classpath as well.\n\nWhy a JMTI agent and not bytecode instrumentation?\n--------------------------------------------------\n\nA JMTI agent has several advantages over bytecode instrumentation:\n\n - It also reports exceptions raised by the VM (eg. `NullPointerException` or `ArithmeticException`) or native code (eg. `IOException`).\n - It should have a much smaller overhead.\n - It less intrusive for things like debugging.\n - It is unaffected by class file format changes.\n\nHow long until the 32bit counter overflows?\n-------------------------------------------\n\nWith 60 exceptions per second after a year.\n\nWhy also reporting caught exceptions?\n-------------------------------------\n\nIf you run inside a framework or container you will likely have a top-level exception handler that catches everything. Therefore you're unlikely to have any uncaught exceptions.\n\nWhich exceptions are not reported?\n----------------------------------\n\nTo quote from the [JMTI documentation](http://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#Exception)\n\n\u003e If an exception is set and cleared in a native method (and thus is never visible to Java programming language code), no exception event is generated. \n\nI'm seeing lots of exceptions but everything seems to work fine?\n----------------------------------------------------------------\n\nYou may be using libraries or frameworks that rely on exceptions for control flow. In addition central parts of Java like class loading use exceptions for control flow.\n\nWhat are the requirements of the C compiler?\n--------------------------------------------\n\nThe compiler should support C11 Atomics and provide the stdatomic.h header.\n\nI need more information about my exceptions, where and when they happen.\n------------------------------------------------------------------------\n\nYou may want to look into licensing [Java Mission Control](http://www.oracle.com/technetwork/java/javaseproducts/mission-control/java-mission-control-1998576.html).\n\nShould I run random JVM agents from people on the Internet?\n-----------------------------------------------------------\n\nYou should most definitely not. You should review the source and build from the source.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarschall%2Fexception-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarschall%2Fexception-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarschall%2Fexception-counter/lists"}