# User land function to get memory left to allocate

- Thread: https://externals.io/message/124698
- Original archive: https://news-web.php.net/php.internals/124698
- Started by Florian Engelhardt on 2024-07-31T12:07:11+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #124698 — Florian Engelhardt — 2024-07-31T12:07:11+00:00

URL: https://externals.io/message/124698#124698

Hey folks,

in this PR[1] it got mentioned that it could be beneficial to add a
userland function that tells you how much memory there is still available
for you to allocate.
I am writing to ask for your opinion on this, because technically it should
be doable with a few lines of user land code (see the change in the PR, at
least for Linux). Nevertheless it could be nice to have such a function
telling you how much memory there is left before the inevitable.
I really don't know if that would be beneficial to any other case than
these tests, but maybe there are some opinions here.

Kind regards
Florian

[1] https://github.com/php/php-src/pull/14895
