{"id":18258794,"url":"https://github.com/manoelcampos/java-collections-advisor","last_synced_at":"2025-10-26T02:42:24.302Z","repository":{"id":141150213,"uuid":"417448928","full_name":"manoelcampos/java-collections-advisor","owner":"manoelcampos","description":"An experimental Java 11 Agent to intercept JDK Collection calls, compute metrics and provide some advices (WIP)","archived":false,"fork":false,"pushed_at":"2021-10-30T11:15:37.000Z","size":204,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T18:20:38.246Z","etag":null,"topics":["byte-buddy","instrumentation","instrumentation-agent","java","java-11","java-agent"],"latest_commit_sha":null,"homepage":"http://manoelcampos.com/java-collections-advisor","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manoelcampos.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":"2021-10-15T09:50:50.000Z","updated_at":"2022-01-24T23:21:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"8dd865ef-256c-4c02-8ded-f61700f41082","html_url":"https://github.com/manoelcampos/java-collections-advisor","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/manoelcampos%2Fjava-collections-advisor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manoelcampos%2Fjava-collections-advisor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manoelcampos%2Fjava-collections-advisor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manoelcampos%2Fjava-collections-advisor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manoelcampos","download_url":"https://codeload.github.com/manoelcampos/java-collections-advisor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247944679,"owners_count":21022615,"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":["byte-buddy","instrumentation","instrumentation-agent","java","java-11","java-agent"],"created_at":"2024-11-05T10:34:42.024Z","updated_at":"2025-10-26T02:42:24.238Z","avatar_url":"https://github.com/manoelcampos.png","language":"Java","readme":"# Java Collections Advisor [![Build Status](https://github.com/manoelcampos/collections-buddy/actions/workflows/maven.yml/badge.svg)](https://github.com/manoelcampos/collections-buddy/actions/workflows/maven.yml)\n\n## 1. Introduction\n\n## 2. Build and Running\n\nIn order to just try the agent you have two options:\n\n- run the `com.manoelcampos.collectionsadvisor.AgentEntry` class from the [agent](agent) dir in your IDE;\n- or execute the [agent/run.sh](agent/run.sh) script.\n\n### 2.1. Running an independent app\n\nIf you are building your own app and want to load the agent during application startup, check the [sample-app](sample-app) project. Execute the [sample-app/run.sh](sample-app/run.sh) script to build and run the app using the agent.\n\nThe sample app has no agent code and the instrumentation happens in runtime.\n\n## 3. Results after running the agent with your app\n\nCurrent results are very basic since this is a working in progress.\nThe agent is not giving any advice about collections utilization yet.\nCheck an example of the agent results over a sample\napp using some Collections.\n\n```\n# Collections Advisor Agent\n## Intercepted java.util.Collection methods calls from com.sample package\n\njava.util.ArrayList from com.sample.ArrayListRegularSample:\n  \tCalls: 23 Lookups: 10 Clear Ups: 0\n\tCapacity changes: 1 -\u003e inc 1 dec 0 | Size changes: 11 -\u003e inc 10 dec 1\n\tInserts: 10 -\u003e head 0 middle 0 tail 10 moves 0\n\tRemovals: 1 -\u003e head 0 middle 0 tail 1 moves 0\njava.util.ArrayList from com.sample.ArrayListAsQueueSample:\n  \tCalls: 31 Lookups: 0 Clear Ups: 0\n\tCapacity changes: 1 -\u003e inc 1 dec 0 | Size changes: 20 -\u003e inc 10 dec 10\n\tInserts: 10 -\u003e head 0 middle 0 tail 10 moves 0\n\tRemovals: 10 -\u003e head 9 middle 0 tail 1 moves 45\njava.util.ArrayList from com.sample.ArrayListHeadAddSample:\n  \tCalls: 10 Lookups: 0 Clear Ups: 0\n\tCapacity changes: 1 -\u003e inc 1 dec 0 | Size changes: 10 -\u003e inc 10 dec 0\n\tInserts: 10 -\u003e head 9 middle 0 tail 1 moves 45\n\tRemovals: 0 -\u003e head 0 middle 0 tail 0 moves 0\njava.util.LinkedList from com.sample.LinkedListSample:\n  \tCalls: 22 Lookups: 10 Clear Ups: 1\n\tCapacity changes: 0 -\u003e inc 0 dec 0 | Size changes: 11 -\u003e inc 10 dec 1\n\tInserts: 10 -\u003e head 0 middle 0 tail 10 moves 0\n\tRemovals: 0 -\u003e head 0 middle 0 tail 0 moves 0\n```\n\n## 4. References\n\n- [ByteBuddy Tutorial](https://bytebuddy.net/#/tutorial)\n- [Runtime Code Generation with Byte Buddy](https://blogs.oracle.com/javamagazine/post/runtime-code-generation-with-byte-buddy)\n- [Fixing Bugs in Running Java Code with Dynamic Attach](https://www.sitepoint.com/fixing-bugs-in-running-java-code-with-dynamic-attach/)\n- [How to Make Java More Dynamic with Runtime Java Code Generation (1/2)](https://www.jrebel.com/blog/runtime-java-code-generation-guide)\n- [Using Byte Buddy for Annotation Driven Java (2/2)](https://www.jrebel.com/blog/using-byte-buddy-for-annotation-driven-java)\n- [Rafael Winterhalter - The definitive guide to Java agents (JPoint 2019)](https://youtu.be/OF3YFGZcQkg)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanoelcampos%2Fjava-collections-advisor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanoelcampos%2Fjava-collections-advisor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanoelcampos%2Fjava-collections-advisor/lists"}