Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

High memory usage growing with each consecutive test

Open
#78 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
testing

Research direction

Start by reproducing the issue with tests/unit/leak/A500Test.php, tests/unit/leak/A1000Test.php, and the combined tests/unit/leak/ run, then compare the result with Yii2 disabled in unit.suite.yml. Trace the module behavior involved in each test iteration; done means memory no longer grows by roughly 300 MB across the reported runs while all tests pass.

Written by the indexing model from the issue text.

Description

Steps to reproduce:

  1. Install basic yii2 template
  2. Add tests https://github.com/arrilot/yii2-codeception-memory-leak-demo/pull/1/files
  3. run vendor/bin/codecept run tests/unit/leak/A500Test.php
Time: 00:02.015, Memory: 156.00 MB
OK (500 tests, 500 assertions)
  1. run vendor/bin/codecept run tests/unit/leak/A1000Test.php
Time: 00:06.381, Memory: 300.00 MB
OK (1000 tests, 1000 assertions)

1000 tests consumed twice as much memory as 500 tests.
Module is not freeing 300kb of memory after each iteration of one test

  1. run both test files - vendor/bin/codecept run tests/unit/leak/
Time: 00:12.377, Memory: 446.00 MB
OK (1500 tests, 1500 assertions)

Module is not freeing 300kb of memory after each test even after all tests in a file were finished

  1. comment Yii2 module out in unit.suite.yml
Time: 00:00.349, Memory: 20.00 MB
OK (1500 tests, 1500 assertions)

Memory usage is 20 smaller

phpinfo.txt

Dominant language
PHP
Stars
19
Forks
42
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Codeception/module-yii2

All issues in Codeception/module-yii2

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.