{"id":42761215,"url":"https://github.com/starwit/jvm-object-counter","last_synced_at":"2026-01-29T20:34:08.851Z","repository":{"id":248829990,"uuid":"829892901","full_name":"starwit/jvm-object-counter","owner":"starwit","description":"This is a tool, that reads some stats from a remote JVM via JMX protocol","archived":false,"fork":false,"pushed_at":"2024-07-26T11:29:00.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-07-26T13:28:19.600Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/starwit.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":"2024-07-17T07:47:12.000Z","updated_at":"2024-07-26T11:29:04.000Z","dependencies_parsed_at":"2024-07-25T13:13:21.886Z","dependency_job_id":"8df1de79-e9b7-4604-b833-953dac3ed370","html_url":"https://github.com/starwit/jvm-object-counter","commit_stats":null,"previous_names":["starwit/jvm-object-counter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/starwit/jvm-object-counter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fjvm-object-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fjvm-object-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fjvm-object-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fjvm-object-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starwit","download_url":"https://codeload.github.com/starwit/jvm-object-counter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fjvm-object-counter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28884291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T19:55:09.949Z","status":"ssl_error","status_checked_at":"2026-01-29T19:55:08.490Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-29T20:34:07.491Z","updated_at":"2026-01-29T20:34:08.844Z","avatar_url":"https://github.com/starwit.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JVM Object Counter\nThis is a tool, that reads some stats from a remote JVM via JMX protocol. It starts a HSQLDB and writes object count per class. \n\n## General idea\nIn Java software at times too many objects or too large objects are created. If that happens, a full garbage collection can be triggered and that will stop your application. With garbage collection logging activated, you can get an idea how much data is moved on Java's heap. However you don't know, which objects are created and how much memory they use. This tool aims at collecting a more detailed statistic, to break down number and size of objects on heap. \n\nData source is object histogram that is offered from MBean DiagnosticCommand via JMX. For more details see [JavaDoc] (https://docs.oracle.com/javase/8/docs/jre/api/management/extension/com/sun/management/DiagnosticCommandMBean.html)\n\n__Note__ Operation _gcClassHistogram_ appears to cause full GC. If that's the case, this will slow down your app significantly.\n\n## How to build\nThis app uses Maven to build and package. Run following commands in repo's base folder.\n```bash\n    mvn clean package\n    java -jar target/jvmcounter.jar\n```\n\n## How to run\nSimply run jar file with Java (version \u003e= 21). App will start an embedded HSQLDB to which you can connect on port 9001, credentials can be set via application properties - see next section. Collected data can be analyzed from HSQLDB using other tools.\n\n## How to configure\nIf application detects application.properties file in same directory, this will be loaded and overrides any internal config. Shipped property file can be found [here](src/main/resources/application.properties).\n```properties\n    remotejvm.url=service:jmx:rmi:///jndi/rmi://host:port/jmxrmi\n    remotejvm.enableAuth=false\n    remotejvm.username=\n    remotejvm.password=\n\n    storage.hsqldb.pw=agoodpassword\n    storage.hsqldb.path=\n\n    # be careful - lower is faster. milliseconds\n    instrumenting.sampleTime=5000\n    instrumenting.collectObjects=false\n    instrumenting.minimumObjectCount=1\n    instrumenting.minimumObjectSize=1024\n    instrumenting.printAllMBeans=false\n    instrumenting.printObjectCount=true\n    instrumenting.printAll=false\n    instrumenting.collectThreads=true\n    instrumenting.threadOutputFile=threadlog.csv\n```\n\n## How to analyze\nIf you run tool, you'll end up with a HSQL database, that you can use for further analysis. Just start HSQLDB like so:\n```bash\n    java -cp ./hsqldb.jar org.hsqldb.Server --database.0 file:path/gclogs --dbname.0 gclogs\n```\nNecessary jar can be downloaded on HSQLDB's web page: https://hsqldb.org/\n\nProject also has a tool, that extracts database into a flat CSV file. This can then be used with tools like Python/Pandas for further analysis. TODO more details on that.\n\n# License\nThis software is published under Apache 2.0 license and file with license agreement can be found [here](LICENSE). ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarwit%2Fjvm-object-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarwit%2Fjvm-object-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarwit%2Fjvm-object-counter/lists"}