PHPackages                             kanel/memoryusage - 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. kanel/memoryusage

ActiveLibrary

kanel/memoryusage
=================

a basic php lclass to track memory usage

2.0.1(8y ago)0521PHPPHP &gt;=7.0

Since Apr 2Pushed 8y agoCompare

[ Source](https://github.com/elkaadka/MemoryUsage)[ Packagist](https://packagist.org/packages/kanel/memoryusage)[ RSS](/packages/kanel-memoryusage/feed)WikiDiscussions master Synced 2mo ago

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

[![build](https://camo.githubusercontent.com/28e90e584c21b66921a59750245301ad3caf0984d03071955587fe963c449036/68747470733a2f2f7472617669732d63692e6f72672f656c6b6161646b612f4d656d6f727955736167652e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/28e90e584c21b66921a59750245301ad3caf0984d03071955587fe963c449036/68747470733a2f2f7472617669732d63692e6f72672f656c6b6161646b612f4d656d6f727955736167652e7376673f6272616e63683d6d6173746572)

A simple Memory usage tracking class to benchmark functions or code execution memory consumption

\#How it works :

- Start the memory tracking ```
        MemoryUsage::start();

    ```
- Mark a place as a lap (the memory tracking will continue counting after returning the difference between the start and this lap) ```
        $memoryUsage = MemoryBench::lap();

    ```

    Where $memoryUsage is instance of class : ```
    class MemoryUsage
    {
            protected $memory;
            protected $realMemory;
            protected $memoryPeak;
            protected $realMemoryPeak;
    }

    ```
- If you want the memory used between this lap and the last one, send the following constant as a parameter: ```
        $memoryUsage = MemoryBench::lap(MemoryBench::FROM_LAST_LAP);

    ```
- To stop the memory usage tracking and get the memory used from the beginning (the start) ```
        $memoryUsage = MemoryBench::stop();

    ```
- To stop the memory tracking and get the memory used from the last lap ```
        $memoryUsage = MemoryBench::stop(MemoryBench::FROM_LAST_LAP);

    ```
- To get the history of tracked memory ```
        $memoryUsages = MemoryBench::getHistory();

    ```

    Where $memoryUsages is an array of MemoryUsage classes

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~90 days

Total

3

Last Release

3150d ago

Major Versions

1.0.0 → 2.0.02017-09-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/3215e882ee8ae39a8b904d0958420f68bf23b2cf0e22175d5a61513f98e6ef64?d=identicon)[elkaadka](/maintainers/elkaadka)

---

Top Contributors

[![elkaadka](https://avatars.githubusercontent.com/u/24205608?v=4)](https://github.com/elkaadka "elkaadka (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kanel-memoryusage/health.svg)

```
[![Health](https://phpackages.com/badges/kanel-memoryusage/health.svg)](https://phpackages.com/packages/kanel-memoryusage)
```

PHPackages © 2026

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