PHPackages                             orlandothoeny/memory-limiter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. orlandothoeny/memory-limiter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

orlandothoeny/memory-limiter
============================

PHP library that can read the available memory and set limit to currently free memory

1.0.0(1y ago)47MITPHPPHP ^8.2CI passing

Since Aug 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/orlandothoeny/memory-limiter)[ Packagist](https://packagist.org/packages/orlandothoeny/memory-limiter)[ RSS](/packages/orlandothoeny-memory-limiter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Memory Limiter
==============

[](#memory-limiter)

[![Latest Stable Version](https://camo.githubusercontent.com/bccbe4a113d43b1bdd3eaea70475f39ea67291977715b00564fcb7cbbedc2608/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f726c616e646f74686f656e792f6d656d6f72792d6c696d69746572)](https://packagist.org/packages/orlandothoeny/memory-limiter)[![PHP Version](https://camo.githubusercontent.com/1b3abdea18a3fdea8fa1a97784a7b88f78462bb38914612d9d044e87f630f4b2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e322d726762283132302c2532303132342c253230313831293f6c6f676f3d706870)](https://packagist.org/packages/orlandothoeny/memory-limiter)[![codecov](https://camo.githubusercontent.com/77f007ab25a4093be0dd255138d28fad39273818bcfbe96ab0efeb11184b0842/68747470733a2f2f636f6465636f762e696f2f6769746875622f6f726c616e646f74686f656e792f6d656d6f72792d6c696d697465722f67726170682f62616467652e7376673f746f6b656e3d47524959435854365350)](https://codecov.io/github/orlandothoeny/memory-limiter)[![PHPStan level](https://camo.githubusercontent.com/0359fa1a8066f029b443b0b0ba5e09cca604576f5eca002cca80375e54992f83/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e5f6c6576656c2d392d7267622833372c39392c32333529)](https://camo.githubusercontent.com/0359fa1a8066f029b443b0b0ba5e09cca604576f5eca002cca80375e54992f83/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e5f6c6576656c2d392d7267622833372c39392c32333529)[![Dependencies](https://camo.githubusercontent.com/362f3147d6d872f00bdfac74a399d2f19e2e9c2e5f3a34cb6218eb742e123eba/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e64656e63795f636f756e742d302d3838353633303f6c6f676f3d636f6d706f736572)](https://camo.githubusercontent.com/362f3147d6d872f00bdfac74a399d2f19e2e9c2e5f3a34cb6218eb742e123eba/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e64656e63795f636f756e742d302d3838353633303f6c6f676f3d636f6d706f736572)[![License](https://camo.githubusercontent.com/4fc64a4ff21554461e2d30dc3edf912b9245490c505fb0aee4e351d54a01357e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f726c616e646f74686f656e792f6d656d6f72792d6c696d69746572)](https://packagist.org/packages/orlandothoeny/memory-limiter)[![Downloads](https://camo.githubusercontent.com/74b1a320ee2ea1f91649ebd559179c889a4e42e3ec2c14292fbcca068afb51a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f726c616e646f74686f656e792f6d656d6f72792d6c696d69746572)](https://packagist.org/packages/orlandothoeny/memory-limiter)

Memory Limiter is a PHP library that contains functionality to read the currently available/free memory of the system and to set the PHP memory limit according to the available memory.

Supports the following environments:

- Bare Metal Linux
- VM Linux
- Kubernetes Linux container
- Linux container (Docker, Podman, etc.)

### Installation

[](#installation)

```
composer require orlandothoeny/memory-limiter
```

Usage
-----

[](#usage)

### Get currently available/free memory

[](#get-currently-availablefree-memory)

```
