{"id":37020234,"url":"https://github.com/jerolba/jmnemohistosyne","last_synced_at":"2026-01-14T02:16:51.136Z","repository":{"id":57725588,"uuid":"171161196","full_name":"jerolba/jmnemohistosyne","owner":"jerolba","description":"JMnemohistosyne executes programmatically memory histograms of Java process","archived":false,"fork":false,"pushed_at":"2019-03-27T17:32:20.000Z","size":83,"stargazers_count":15,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T19:09:39.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jerolba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-17T19:12:46.000Z","updated_at":"2024-03-31T14:22:08.000Z","dependencies_parsed_at":"2022-09-26T21:51:13.609Z","dependency_job_id":null,"html_url":"https://github.com/jerolba/jmnemohistosyne","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jerolba/jmnemohistosyne","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerolba%2Fjmnemohistosyne","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerolba%2Fjmnemohistosyne/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerolba%2Fjmnemohistosyne/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerolba%2Fjmnemohistosyne/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jerolba","download_url":"https://codeload.github.com/jerolba/jmnemohistosyne/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerolba%2Fjmnemohistosyne/sbom","scorecard":{"id":515885,"data":{"date":"2025-08-11","repo":{"name":"github.com/jerolba/jmnemohistosyne","commit":"00b89f24f60c8e6af5a43beb935bb17ee7c42730"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T01:48:59.881Z","repository_id":57725588,"created_at":"2025-08-20T01:48:59.882Z","updated_at":"2025-08-20T01:48:59.882Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":"2026-01-14T02:16:50.483Z","updated_at":"2026-01-14T02:16:51.125Z","avatar_url":"https://github.com/jerolba.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://img.shields.io/maven-central/v/com.jerolba/jmnemohistosyne.svg)](https://maven-badges.herokuapp.com/maven-central/com.jerolba/jmnemohistosyne)\n[![Build Status](https://circleci.com/gh/jerolba/jmnemohistosyne.svg?style=shield)](https://circleci.com/gh/jerolba/jmnemohistosyne) \n[![Download](https://api.bintray.com/packages/jerolba/maven/jmnemohistosyne/images/download.svg)](https://bintray.com/jerolba/maven/jmnemohistosyne/_latestVersion)\n[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n[![Codecov](https://codecov.io/gh/jerolba/jmnemohistosyne/branch/master/graph/badge.svg)](https://codecov.io/gh/jerolba/jmnemohistosyne/)\n\n\n# JMnemohistosyne\n\nJMnemohistosyne executes programmatically memory histogram of current process using available system `jcmd` command. Parses its output to get the number of instantiated classes and memory consumption of each class.\n\nJMnemohistosyne uses the `jmd` command with the `GC.class_histogram` flag, that forces the execution of a full garbage collection. Remember that `jcmd` command **is only available in JDK**, not in JRE.\n\nFull garbage collection and memory histogram are expensive operations. It is not recommendable to run JMnemohistosyne in production.\n\nOnly live objects are profiled and it inspects all objects in heap, used by your own code or by the JVM.\n\n## Current memory histogram\n\nTo get a histogram of all objects in memory you create a Histogramer object and call to the createHistogram() method, which will return a MemoryHistogram:\n\n```java\nHistogramer histogramer = new Histogramer();\nMemoryHistogram histogram = histogramer.createHistogram();\n\nHistogramEntry arrayList = histogram.get(\"java.util.ArrayList\");\nSystem.out.println(arrayList.getInstances());\nSystem.out.println(arrayList.getSize());\n\nfor (HistogramEntry entry : histogram) {\n    System.out.println(entry);\n}\n```\n\n`MemoryHistogram` class is an iterable collection of `HistogramEntry` objects containing: class name, number of instances and total size of all instances.\n\nYou can also search for a particular class by passing its full name to the get method.\n\nAll objects in memory are counted, created directly or indirectly by your code or by the JVM in its internal operations.\n\n## Memory histogram difference in code execution\n\nWe can measure the number of living objects instantiated within a section of code using a lambda that contains it:\n\n```java\nMemoryHistogram diff = Histogramer.getDiff(() -\u003e {\n    HashMap\u003cInteger, String\u003e map = new HashMap\u003c\u003e();\n    for (int i = 0; i \u003c 10000; i++) {\n        map.put(i, \"\" + i);\n    }\n    return map;\n});\n\nHistogramEntry nodes = diff.get(\"java.util.HashMap$Node\");\nSystem.out.println(nodes.getInstances());\nSystem.out.println(nodes.getSize());\n```\n\nHistogramer will take a snapshot of memory histogram before executing lambda code. After executing your code it creates other histogram and calculates the difference between both histograms.\n\nYou can put all the code you want and call all the needed code inside the lambda, but be sure that all the instances that you want to be taken into account are referenced by some object that already existed outside the lambda or are referenced by the object that returns the lambda (that implements Supplier\u003c?\u003e). Otherwise, by forcing the garbage collection the instances will not appear in the histogram and will be lost in memory, like tears in rain.\n\n## Filtering\n\n`MemoryHistogram` class is an iterable collection of `HistogramEntry` objects which contains: class name, number of instances and size of all instancess.\n\nA `MemoryHistogram` can be filtered using the `filter` method with a varargs of:\n\n- Class name including package: `java.util.HashMap`\n- Class name with a final wildcard: `java.util.HashMap*`\n- Class object: `HashMap.class`\n- Regular expression patter over complete class name: `Pattern.compile(\".*List\")`\n\n```java\nMemoryHistogram filterd = histogram.filter(\"Object[]\", \"java.util.HashMap*\", ArrayList.class, Pattern.compile(\".*Hibernate.*\"));\n```\n\nAll options are applied to the histogram and joined in a new `MemoryHistogram`. \n\n## Dependency\n\nJMnemohistosyne is uploaded to Maven Central Repository and to use it, you need to add the following Maven dependency:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.jerolba\u003c/groupId\u003e\n  \u003cartifactId\u003ejmnemohistosyne\u003c/artifactId\u003e\n  \u003cversion\u003e0.2.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nin Gralde:\n\n`implementation 'com.jerolba:jmnemohistosyne:0.2.3'`\n\nor download the single [jar](http://central.maven.org/maven2/com/jerolba/jmnemohistosyne/0.2.3/jmnemohistosyne-0.2.3.jar) from Maven Central Repository.\n\n### JDK\n\nJMnemohistosyne depends on the presence of the `jcmd` command in the path. Then, check that the JDK is installed and is accesible from command line.\n\nCurrently it is tested in the [CI system](https://circleci.com/gh/jerolba/jmnemohistosyne) against: Oracle JDK 8, OpenJDK 8 and OpendJDK 11. \n\n## Contribute\n\nFeel free to dive in! [Open an issue](https://github.com/jerolba/jmnemohistosyne/issues/new) or submit PRs.\n\nAny contributor and maintainer of this project follows the [Contributor Covenant Code of Conduct](https://github.com/jerolba/jmnemohistosyne/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\n[Apache 2](https://github.com/jerolba/jmnemohistosyne/blob/master/LICENSE.txt) © Jerónimo López","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerolba%2Fjmnemohistosyne","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerolba%2Fjmnemohistosyne","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerolba%2Fjmnemohistosyne/lists"}