# Managed spell elastic pool **🟡 Intermediate · Lesson 42** Lease pooled objects and give them back by hand - Existence.managed_spell_quantity. A managed spell's objects live in a pool its root conduit owns. A meld takes an idle object, or builds one when none is waiting; ReleaseManagedSpell().release(obj) gives it back, and the next meld reuses it (the newest released object first). Nothing returns an object automatically: you decide when it goes back. Elastic is the default mode: a meld never refuses, and managed_spell_limit (256 by default) is how many IDLE objects the pool keeps. With a small limit, a release that would keep more idle objects than the limit destroys the oldest idle one - its disposal methods run. Root teardown disposes the idle objects; describe(cls) shows what is alive, idle and out at any moment. ## Before you run Use the [Intermediate guide](../../intermediate/index.md) for prerequisite concepts. Run from a checkout with Melder installed and Python 3.14 free-threading selected. The collection download includes the level's local helper modules. ## Run the saved script ```bash python UX_and_AIX_experiences/02_intermediate/42_managed_spell_elastic_pool.py ``` ```powershell py -3.14t UX_and_AIX_experiences/02_intermediate/42_managed_spell_elastic_pool.py ``` {download}`Download this collection <../../downloads/intermediate-examples.zip>` · [Source on GitHub](https://github.com/Synaptic724/melder/blob/0895ce795453cd87e35d70665957b4e89aad3317/UX_and_AIX_experiences/02_intermediate/42_managed_spell_elastic_pool.py) ## Public surface md.Spellbook.bind (managed_spell_mode, managed_spell_limit, disposal_method_names), md.Existence.managed_spell_quantity, md.ManagedSpellMode.elastic, md.Conduit.meld, md.Conduit.has_live_creation, md.ReleaseManagedSpell (release, describe), md.Conduit.cleanup ## Code ```{literalinclude} ../../downloads/02_intermediate/42_managed_spell_elastic_pool.py :language: python :linenos: ``` ## Check the outcome The script contains its own assertions or demonstrated refusal paths. Run it to evaluate those checks against your installed version. The code above is taken directly from the saved file; no run output is invented here. [More intermediate examples](index.md) · [Level guide](../../intermediate/index.md) ## Related guides - [Managed spell pools](../../intermediate/managed-spells.md) ## API contracts - [Spellbook](../../reference/api/binding/spellbook.md) - [Conduit](../../reference/api/resolution/conduit.md) - [Existence](../../reference/api/resolution/existence.md) - [ManagedSpellMode](../../reference/api/resolution/managedspellmode.md) - [ReleaseManagedSpell](../../reference/api/resolution/releasemanagedspell.md)