PHPackages                             rapidmail/laravel-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. rapidmail/laravel-memory

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

rapidmail/laravel-memory
========================

A Laravel package to get PHP memory usage and limit, with faking support.

1.0.1(4mo ago)091↓90%MITPHPPHP ^8.3CI passing

Since Mar 30Pushed 4mo agoCompare

[ Source](https://github.com/rapidmail/laravel-memory)[ Packagist](https://packagist.org/packages/rapidmail/laravel-memory)[ RSS](/packages/rapidmail-laravel-memory/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Laravel Memory
==============

[](#laravel-memory)

[![Run Tests](https://github.com/rapidmail/laravel-memory/actions/workflows/run-tests.yml/badge.svg)](https://github.com/rapidmail/laravel-memory/actions/workflows/run-tests.yml)

A simple Laravel package to get PHP memory usage and limit, with faking support for testing.

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

[](#installation)

You can install the package via composer:

```
composer require rapidmail/laravel-memory
```

Usage
-----

[](#usage)

You can use the `Memory` facade to get memory information:

```
use RapidmailLibs\Memory\Facades\Memory;

// Get current memory usage in bytes
$usage = Memory::getMemoryUsage();

// Get real memory usage in bytes (allocated by PHP)
$realUsage = Memory::getRealMemoryUsage();

// Get PHP memory limit in bytes (or null if none is set)
$limit = Memory::getMemoryLimit();
```

### Testing

[](#testing)

You can fake the values in your tests:

```
Memory::fakeMemoryUsage(1024);
Memory::fakeRealMemoryUsage(2048);
Memory::fakeMemoryLimit('512M'); // Accepts shorthand or bytes

Memory::getMemoryUsage(); // 1024
Memory::getRealMemoryUsage(); // 2048
Memory::getMemoryLimit(); // 536870912
```

To fake no memory limit:

```
Memory::fakeMemoryLimit(-1);

Memory::getMemoryLimit(); // null
```

Testing
-------

[](#testing-1)

```
composer lint
composer phpstan
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance75

Regular maintenance activity

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

136d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25850436?v=4)[positive rapidmail](/maintainers/rapidmail)[@rapidmail](https://github.com/rapidmail)

---

Top Contributors

[![eth8505](https://avatars.githubusercontent.com/u/1136509?v=4)](https://github.com/eth8505 "eth8505 (10 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/rapidmail-laravel-memory/health.svg)

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

###  Alternatives

[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329575.9k33](/packages/codewithdennis-filament-select-tree)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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