{"id":24800535,"url":"https://github.com/sakanjo/memory-limited","last_synced_at":"2025-09-23T19:53:45.251Z","repository":{"id":219334348,"uuid":"748784630","full_name":"sakanjo/memory-limited","owner":"sakanjo","description":"A package to limit the memory upon a function call.","archived":false,"fork":false,"pushed_at":"2024-05-14T15:53:15.000Z","size":5,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-28T03:46:29.817Z","etag":null,"topics":["ini","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sakanjo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"sakanjo"}},"created_at":"2024-01-26T18:57:39.000Z","updated_at":"2024-09-01T07:28:57.000Z","dependencies_parsed_at":"2024-02-12T13:48:02.996Z","dependency_job_id":null,"html_url":"https://github.com/sakanjo/memory-limited","commit_stats":null,"previous_names":["sakanjo/memory-limited"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakanjo%2Fmemory-limited","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakanjo%2Fmemory-limited/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakanjo%2Fmemory-limited/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakanjo%2Fmemory-limited/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sakanjo","download_url":"https://codeload.github.com/sakanjo/memory-limited/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236289398,"owners_count":19125009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ini","php"],"created_at":"2025-01-30T03:19:19.991Z","updated_at":"2025-09-23T19:53:40.203Z","avatar_url":"https://github.com/sakanjo.png","language":"PHP","funding_links":["https://github.com/sponsors/sakanjo"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eMemory limited\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://php.net\"\u003e\u003cimg alt=\"PHP 8.0\" src=\"https://img.shields.io/badge/PHP-8.0-777BB4?style=for-the-badge\u0026logo=php\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eDon't eat my memory please\u003c/p\u003e\n\n\u003e ✨ Help support the maintenance of this package by [sponsoring me](https://github.com/sponsors/sakanjo).\n\nTable of contents\n=================\n\n* [Install](#install)\n* [Usage](#usage)\n* [Support the development](#support-the-development)\n* [Credits](#credits)\n* [License](#license)\n\n## 📦 Install\n\n```\ncomposer require --dev sakanjo/memory-limited\n```\n\n## 🦄 Usage\n\n```php\nuse function Sakanjo\\MemoryLimited\\run_memory_limited;\n\nfunction memoryEater(): mixed\n{\n    return memoryEater();\n}\n\nrun_memory_limited(mb: 20, callback: function() {\n    memoryEater(); // It will throw FATAL when reaching 20M of memory, instead of hanging the system\n});\n```\n\nVoila, that's it!\n\n\u003e Pay attention that this package is only used in **development** mode for testing purposes,\n\u003e it will throw **Fatal error** when the memory limit is reached.\n\n## 💖 Support the development\n\n**Do you like this project? Support it by donating**\n\nClick the [\"💖 Sponsor\"](https://github.com/sponsors/sakanjo) at the top of this repo.\n\n## ©️ Credits\n\n- [Salah Kanjo](https://github.com/sakanjo)\n- [All Contributors](../../contributors)\n\n## 📄 License\n\n[MIT License](https://github.com/sakanjo/sakanjo/memory-limited/blob/master/LICENSE) © 2023-PRESENT [Salah Kanjo](https://github.com/sakanjo)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakanjo%2Fmemory-limited","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsakanjo%2Fmemory-limited","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakanjo%2Fmemory-limited/lists"}