# Resource pooling - to avoid dynamic allocation

**URL:** <https://discourse.julialang.org/t/resource-pooling-to-avoid-dynamic-allocation/16921>\
**Category:** General Usage\
**Created:** [October 29, 2018, 1:52pm UTC](https://discourse.julialang.org/t/resource-pooling-to-avoid-dynamic-allocation/16921 "2018-10-29T13:52:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stemann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stemann/32/4030_2.png) [@stemann](https://discourse.julialang.org/u/stemann)\
**Post date:** [October 29, 2018, 1:52pm UTC](https://discourse.julialang.org/t/resource-pooling-to-avoid-dynamic-allocation/16921/1 "2018-10-29T13:52:48Z")

</div>

Hi,

I have been looking for a package that implements resource pooling? I.e. a package that implements a pool of (reference counted) resources to avoid dynamic allocation of “expensive” resources such as large arrays, images, network connections etc.

Best regards,  
Jesper

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [October 29, 2018, 4:30pm UTC](https://discourse.julialang.org/t/resource-pooling-to-avoid-dynamic-allocation/16921/2 "2018-10-29T16:30:08Z")

</div>

There is a `CachingPool` for use with `pmap`, for example. Is that sort of what you are after?

---

<div class="post-metadata">

**Author:** ![stemann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stemann/32/4030_2.png) [@stemann](https://discourse.julialang.org/u/stemann)\
**Post date:** [October 30, 2018, 8:47am UTC](https://discourse.julialang.org/t/resource-pooling-to-avoid-dynamic-allocation/16921/3 "2018-10-30T08:47:05Z")

</div>

Not quite, I need something that implements the [Object pool pattern](https://en.wikipedia.org/wiki/Object_pool_pattern) like [GitHub - steinwurf/recycle: Simple resource pool for recycling resources in C++](https://github.com/steinwurf/recycle)
