PHPackages                             bert-w/memory-usage - 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. bert-w/memory-usage

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

bert-w/memory-usage
===================

Retrieve memory info on unix-like systems by reading the '/proc/meminfo' file, with calculations similar to the command 'htop'.

v1.2.0(2y ago)09MITPHPPHP ^8.1

Since Aug 26Pushed 2y ago1 watchersCompare

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

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

bert-w/memory-usage
===================

[](#bert-wmemory-usage)

[![Latest Stable Version](https://camo.githubusercontent.com/52d27485879162af7420d726814246d1b79b9e3579e9dd43903af8b6e4edf5df/68747470733a2f2f706f7365722e707567782e6f72672f626572742d772f6d656d6f72792d75736167652f762f737461626c65)](https://packagist.org/packages/bert-w/memory-usage)[![Total Downloads](https://camo.githubusercontent.com/7ba183f82c8921f9b7b6bd203f336eec34be0af6ed83b48f5fec30b571eec562/68747470733a2f2f706f7365722e707567782e6f72672f626572742d772f6d656d6f72792d75736167652f646f776e6c6f616473)](https://packagist.org/packages/bert-w/memory-usage)[![License](https://camo.githubusercontent.com/c6bc8c3e86a4e6955aa51c32cb89a939354c1a2314a5acc15f27f4ae8d2ef37a/68747470733a2f2f706f7365722e707567782e6f72672f626572742d772f6d656d6f72792d75736167652f6c6963656e7365)](https://packagist.org/packages/bert-w/memory-usage)

Receive information about the current memory usage on your unix machine, similar to the calculations in `htop`.

### Installation instructions

[](#installation-instructions)

`composer require bert-w/memory-usage`

This package is only compatible with unix-like systems. It requires read permissions to the file `/proc/meminfo` which contains details about the memory usage on the system.

### Quick start

[](#quick-start)

Get the current memory usage of your system:

```
$memory = new \BertW\MemoryUsage\MemoryUsage();

$usage = $memory->usedMemory() . ' / ' . $memory->totalMemory();
// Result: "3486252 kB / 8148216 kB"
```

Results are in `kB` (kilobyte) format by default. They can be converted using the `->to()` function which accepts a conversion unit like `'B'`, `'kB'`, `'MB'`, `'GB'`, `'TB'`, `'PB'` or `'EB'`. A handy `__toString()` is included which outputs the value and the unit name:

```
$usage = $memory->usedMemory()->to('GB') . ' / ' . $memory->totalMemory()->to('GB');
// Result: "3.32 GB / 7.77 GB"
```

#### Function list

[](#function-list)

```
(new \BertW\MemoryUsage\MemoryUsage)->usedMemory();
(new \BertW\MemoryUsage\MemoryUsage)->totalUsedMemory();
(new \BertW\MemoryUsage\MemoryUsage)->totalMemory();
(new \BertW\MemoryUsage\MemoryUsage)->cacheMemory();
(new \BertW\MemoryUsage\MemoryUsage)->nonCacheMemory();
(new \BertW\MemoryUsage\MemoryUsage)->swapMemory();
(new \BertW\MemoryUsage\MemoryUsage)->bufferMemory();

(new \BertW\MemoryUsage\MemoryUsage)->meminfo();
// Returns Array with parsed `/proc/meminfo` content (in kilobytes).

(new \BertW\MemoryUsage\MemoryUsage)->get(\BertW\MemoryUsage\Meminfo::Buffers);
(new \BertW\MemoryUsage\MemoryUsage)->get('Buffers');
// Retrieve any value from the `/proc/meminfo` file. Accepts strings and Enums.
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

3

Last Release

995d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10498595?v=4)[Bert](/maintainers/bert-w)[@bert-w](https://github.com/bert-w)

---

Top Contributors

[![bert-w](https://avatars.githubusercontent.com/u/10498595?v=4)](https://github.com/bert-w "bert-w (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bert-w-memory-usage/health.svg)

```
[![Health](https://phpackages.com/badges/bert-w-memory-usage/health.svg)](https://phpackages.com/packages/bert-w-memory-usage)
```

###  Alternatives

[askerakbar/gpt-trix-editor

GPT Trix Editor package extends the default Trix editor features in the Filament PHP framework.

458.1k](/packages/askerakbar-gpt-trix-editor)

PHPackages © 2026

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