{"id":13623943,"url":"https://github.com/chrisvest/stormpot","last_synced_at":"2025-05-14T23:04:18.562Z","repository":{"id":43675053,"uuid":"1511134","full_name":"chrisvest/stormpot","owner":"chrisvest","description":"A fast object pool for the JVM","archived":false,"fork":false,"pushed_at":"2024-12-28T01:35:23.000Z","size":29676,"stargazers_count":372,"open_issues_count":1,"forks_count":44,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-13T19:49:54.967Z","etag":null,"topics":["concurrency","connection-pool","high-performance","java","performance","pool","tdd"],"latest_commit_sha":null,"homepage":"http://chrisvest.github.io/stormpot/","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/chrisvest.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-03-22T12:27:06.000Z","updated_at":"2025-04-09T12:23:13.000Z","dependencies_parsed_at":"2024-06-15T18:30:37.460Z","dependency_job_id":"58c8abb2-524b-47b7-afb6-89bfffc24843","html_url":"https://github.com/chrisvest/stormpot","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisvest%2Fstormpot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisvest%2Fstormpot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisvest%2Fstormpot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisvest%2Fstormpot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisvest","download_url":"https://codeload.github.com/chrisvest/stormpot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243358,"owners_count":22038046,"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":["concurrency","connection-pool","high-performance","java","performance","pool","tdd"],"created_at":"2024-08-01T21:01:37.172Z","updated_at":"2025-05-14T23:04:18.201Z","avatar_url":"https://github.com/chrisvest.png","language":"Java","funding_links":[],"categories":["Java","Memory and concurrency"],"sub_categories":[],"readme":"== Stormpot\n\nStormpot is an object pooling library for Java.\nUse it to recycle objects that are expensive to create.\nThe library will take care of creating and destroying your objects in the\nbackground.\n\nimage:https://github.com/chrisvest/stormpot/actions/workflows/maven.yml/badge.svg[Build status, link=https://github.com/chrisvest/stormpot/actions/workflows/maven.yml]\nimage:https://codecov.io/gh/chrisvest/stormpot/branch/master/graph/badge.svg[Code coverage, link=https://codecov.io/gh/chrisvest/stormpot]\n\nStormpot is very mature, is used in production, and has done hundreds of\ntrillions footnote:[Fermi estimate.] claim-release cycles in testing.\nIt is faster and scales better than any competing pool.\n\n * Home page: http://chrisvest.github.io/stormpot/\n * Source code: https://github.com/chrisvest/stormpot/\n * API docs: http://chrisvest.github.io/stormpot/site/apidocs/index.html\n * Mailing list: http://groups.google.com/d/forum/stormpot\n * License: http://www.apache.org/licenses/LICENSE-2.0.html[The Apache Software\n   License 2.0]\n * Simple versioning: X.Y where Y{plus}{plus} is backwards compatible, and\n   X{plus}{plus} is backwards incompatible.\n\n=== Why choose Stormpot?\n\nThere are a number of options out there, when it comes to object pools on the\nJVM. Stormpot has been carefully designed for high performance, and robust\noperation. Some of the things that sets Stormpot apart include:\n\n * Business friendly http://www.apache.org/licenses/LICENSE-2.0.html[Apache 2\n   license].\n * Very high http://chrisvest.github.io/stormpot/site/jacoco/index.html[test\n   coverage].\n * The https://medium.com/@chrisvest/released-stormpot-2-1-c31509142757[highest\n   throughput and lowest latency] in its class.\n   (since 2.1)\n * https://medium.com/@chrisvest/released-stormpot-2-2-ccd1e8639f07[Automatic\n   recovery] from sporadic backend (Allocator) failures.\n   (since 2.2)\n * Precise object leak detection with virtually no overhead.\n   (since 2.3)\n * Optional background object expiration checking.\n   (since 2.3)\n * Explicit object expiration.\n   (since 2.4)\n * Gradual back-off for prolonged allocation failures.\n   (since 3.0)\n * Support for Java Platform Module system.\n   (since 3.0)\n * Support for a directly-allocating thread-less mode, via `Pool.of(...)`.\n   (since 3.0)\n * Convenient lambda-based API.\n   (since 3.0)\n * Control over the thread-local caching mechanics, via ``PoolTap``s.\n   (since 3.0)\n * Support for operating without a background thread, via `Pool.fromInline()`.\n   (since 3.1)\n * Support for configuring zero-sized (dormant) pools.\n   (since 3.1)\n * Support for virtual threads.\n   (since 4.0)\n * Support for more than 2 billion objects in a pool.\n   (since 4.0)\n * Support for changing the `Allocator` after the pool has been created.\n   (since 4.0)\n * And other features that makes for a smooth runtime behaviour.\n\n[NOTE]\n--\nStormpot is an _object pool_; a homogeneous collection of objects, where it does not matter which particular instance is returned from `claim` since the objects are all similar.\nIf your objects instead are heterogeneous, with different attributes and identified by a _key_, then what you need is a _object cache_.\nWe recommend https://github.com/ben-manes/caffeine[Caffeine] for object caching.\n--\n\n=== Installing\n\nStormpot 4.0 only depends on Java 21 or newer.\nIf you need to use Java 11 or newer, use Stormpot 3.2.\nAdd it as a Maven dependency to your projects:\n\n[source,xml]\n----\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.chrisvest\u003c/groupId\u003e\n  \u003cartifactId\u003estormpot\u003c/artifactId\u003e\n  \u003cversion\u003e4.0\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\nYou can also build the latest snapshot from source with `mvn clean install`.\nNote that Stormpot 4 require Java 21 or newer.\n\n=== Getting Started\n\nStormpot needs 3 things before it can pool objects for you:\n\n . A http://chrisvest.github.io/stormpot/site/apidocs/stormpot/stormpot/Poolable.html[Poolable] type of objects it can pool.\n   You have to implement this yourself.\n . An http://chrisvest.github.io/stormpot/site/apidocs/stormpot/stormpot/Allocator.html[Allocator] to allocate and deallocate the Poolable objects.\n   You have to implement this yourself.\n . And a place where it all comes together:\n\n[source,java]\n----\nMyAllocator allocator = new MyAllocator();\nPool\u003cMyPoolable\u003e pool = Pool.from(allocator).build();\nTimeout timeout = new Timeout(1, TimeUnit.SECONDS);\n\nMyPoolable object = pool.claim(timeout);\ntry {\n  // Do stuff with 'object'.\n  // Note: 'claim' returns 'null' if it times out.\n} finally {\n  if (object != null) {\n    object.release();\n  }\n}\n----\n\n=== Contributing\n\n * *Report bugs* preferably with a failing test. You can submit a pull-request\n   that adds a failing test that demonstrates the behaviour you think is wrong\n   or missing. Travis-CI will build it, report the failure and shorten the\n   feedback cycle. If you don't know how to write a test for something, then\n   that's fine too. Just open an issue describing your configuration and\n   environment, what you observe, and what you think should happen instead.\n * *Improve the documentation* by all means! Just fork the project and start.\n   If you have questions about implementation or behavioural details, then start\n   a discussion about it by opening a pull-request or an issue. Documentation\n   is formatted with http://asciidoctor.org/[AsciiDoctor].\n   The website and javadocs can be generated with\n   `./mvnw clean pre-site javadoc:javadoc`.\n * *Fix bugs or implement features* by forking the project, but please start an\n   issue about the bug or feature you want to work on (or find the existing\n   issue) and describe the approach and design you have in mind. Keep in mind\n   that Stormpot is implemented with a very strict adherence to TDD.\n   Finally, make sure to respect the existing indentation and formatting.\n   Use `./mvnw checkstyle:check` to check your formatting.\n   If you are writing a test that takes more than a few hundred milliseconds to\n   run, then put it in the `stormpot.slow` test package; either in the existing\n   `PoolIT` suite, or in a new `\\*IT` suite.\n   Use `mvn clean test` to run only the fast tests. Use `mvn clean verify` to\n   also run the slow tests. Javadoc comments are formatted with\n   http://asciidoctor.org/[AsciiDoctor].\n   Get test coverage with `./mvnw clean test site` and\n   `open target/site/jacoco/index.html`. Get mutation test coverage with\n   `mvn clean test-compile org.pitest:pitest-maven:mutationCoverage` and\n   `open target/pit-reports/*/index.html`.\n * *Update* Maven plugins with `./mvnw versions:display-plugin-updates`, or other\n   dependencies with `versions:display-dependency-updates`.\n * *Add to the ecosystem* and make Stormpot more than just an object pool.\n   This is a good thing to take on if you'd like to contribute code, but you\n   find the Stormpot code base itself to be intimidating (which, by the way, I\n   completely understand).\n   ** There is a repository for\n      https://github.com/chrisvest/object-pool-benchmarks[object pool benchmarks]\n      that is being maintained along side Stormpot.\n      Adding more benchmarks and cases; analysing results; trying out\n      optimisations.\n      These are all useful things to do.\n   ** I started working on a\n      https://github.com/chrisvest/stormpot-jdbc[JDBC connection pool]\n      based on Stormpot, but the project has stagnated.\n      It is no doubt a useful thing to have, though.\n      If you want to take on that problem, either with offset in the existing\n      code or by starting over from scratch, then please go ahead.\n   ** I'm sure there are other interesting related problems out there to take on.\n      There are many database drivers for various NoSQL databases, that have\n      object pooling needs.\n * *Build benchmarks* with `./mvnw package -DskipTests -f modular-pom.xml`,\n   and run them with `java -jar benchmarks/target/benchmarks.jar`.\n\nWhatever you decide to do, don't hesitate to ask questions in the discussions\non github if you have doubts or get stuck.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisvest%2Fstormpot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisvest%2Fstormpot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisvest%2Fstormpot/lists"}