PHPackages                             samlitowitz/php-memory - 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. samlitowitz/php-memory

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

samlitowitz/php-memory
======================

A library to interact with PHP memory limit

v1.0.2(2y ago)1371[1 issues](https://github.com/samlitowitz/php-memory/issues)Apache-2.0PHP

Since Jul 8Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/samlitowitz/php-memory)[ Packagist](https://packagist.org/packages/samlitowitz/php-memory)[ RSS](/packages/samlitowitz-php-memory/feed)WikiDiscussions master Synced 1w ago

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

PHP Memory
==========

[](#php-memory)

Table of Contents
-----------------

[](#table-of-contents)

1. [Installation](#installation)
2. [Usage](#usage)

Installation
------------

[](#installation)

```
composer require samlitowitz/php-memory
```

Usage
-----

[](#usage)

```
use PhpMemory\MemoryLimit;
use PhpMemory\Unit\Binary\Megabyte;
MemoryLimit::set(Size::create(2, new Megabyte()), true);

echo init_get(MemoryLimit::INI_OPTION);
// 1M
```

```
use PhpMemory\MemoryLimit;
use PhpMemory\Unit\Byte;
MemoryLimit::set(Size::create(100, new Byte()));

echo init_get(MemoryLimit::INI_OPTION);
// 100
```

See [MemoryLimitTest](tests/PhpMemory/MemoryLimitTest.php) for more examples.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~378 days

Total

3

Last Release

1020d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e6d6a1f93b670732d251551067a2e17b9f1a180d164036f0a84896bc95f9edba?d=identicon)[samlitowitz](/maintainers/samlitowitz)

---

Top Contributors

[![samlitowitz](https://avatars.githubusercontent.com/u/4641296?v=4)](https://github.com/samlitowitz "samlitowitz (13 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/samlitowitz-php-memory/health.svg)

```
[![Health](https://phpackages.com/badges/samlitowitz-php-memory/health.svg)](https://phpackages.com/packages/samlitowitz-php-memory)
```

###  Alternatives

[wehaa/liveupdate

A Laravel Nova field.

29184.8k](/packages/wehaa-liveupdate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
