# Memory problems

- Thread: https://externals.io/message/49968
- Original archive: https://news-web.php.net/php.internals/49968
- Started by Yuriy Mykula on 2010-10-25T12:12:04+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #49968 — Yuriy Mykula — 2010-10-25T12:12:04+00:00

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

Hi everybody,
Hope you all are fine.

I am trying to create some small SAPI application that should serve specific 
network requests. Everything went well at the beginning. But I've noticed 
that application is slowly eating memory while left alone for some time. 
Moreover, when application is serving around 100 simultaneous requests 
memory losses are becoming dramatic and application crashes in the end. At 
the other hand if I limit number of threads on SAPI to, let's say, five, 
application looks like being capable of working forever.

At first I was thinking that is a memory leak inside of my code. I started 
to remove parts of the code to isolate the problem and at the end in my 
request handling function I had only four lines of code left:
TSRMLS_FETCH();
php_request_startup(TSRMLS_C);
php_request_shutdown(TSRMLS_C);
return 0;

Surprisingly my problem did not go away. I was trying to solve this thing 
for weeks now. I am rather new to all this php and zend stuff and I suspect 
I am doing something wrong with php initialization. Can anybody be a nice 
person and help me out here?

Best Regards,
Yuriy Mykula
