title: best way to find php memory leak?
body: <p>I have an httpd server handling requests from about 1k active users, i have PHP memory limit set to 128MB.</p>
  
  <p>I've been getting the following error in my logs since my user activity increased drastically</p>
  
  <p><strong>* Error in `/usr/sbin/httpd': malloc(): memory corruption (fast): 0x000055aae4918a9f *</strong></p>
  
  <p>Backtrace: </p>
  
  <pre><code>/lib64/libc.so.6(+0x7f5e4)[0x7fc15c81c5e4]
  /lib64/libc.so.6(+0x82d00)[0x7fc15c81fd00]
  /lib64/libc.so.6(__libc_malloc+0x4c)[0x7fc15c82284c]
  /lib64/libcrypto.so.10(CRYPTO_realloc_clean+0x58)[0x7fc1574334d8]
  /lib64/libcrypto.so.10(BUF_MEM_grow_clean+0x70)[0x7fc1574dcc50]
  /lib64/libcrypto.so.10(+0x1193ad)[0x7fc1574de3ad]
  /lib64/libcrypto.so.10(BIO_write+0x6b)[0x7fc1574dd3cb]
  /lib64/libcrypto.so.10(+0x1419c2)[0x7fc1575069c2]
  /lib64/libcrypto.so.10(+0x141a8e)[0x7fc157506a8e]
  /lib64/libcrypto.so.10(+0x141e04)[0x7fc157506e04]
  /lib64/libcrypto.so.10(+0x141f8b)[0x7fc157506f8b]
  /etc/httpd/modules/mod_ssl.so(+0x259b3)[0x7fc14f9559b3]
  /etc/httpd/modules/mod_ssl.so(+0x20a42)[0x7fc14f950a42]
  /etc/httpd/modules/mod_ssl.so(+0x22701)[0x7fc14f952701]
  /etc/httpd/modules/mod_ssl.so(+0x1c624)[0x7fc14f94c624]
  /usr/sbin/httpd(ap_run_fixups+0x40)[0x55aae3edbd70]
  /usr/sbin/httpd(ap_process_request_internal+0x2da)[0x55aae3ede6fa]
  /usr/sbin/httpd(ap_internal_redirect+0x40)[0x55aae3efb9c0]
  /etc/httpd/modules/mod_rewrite.so(+0x4f6c)[0x7fc1549b6f6c]
  /usr/sbin/httpd(ap_run_handler+0x40)[0x55aae3ee5a80]
  /usr/sbin/httpd(ap_invoke_handler+0x69)[0x55aae3ee5fc9]
  /usr/sbin/httpd(ap_process_async_request+0x1ea)[0x55aae3efc6aa]
  /usr/sbin/httpd(+0x59a49)[0x55aae3ef8a49]
  /usr/sbin/httpd(ap_run_process_connection+0x40)[0x55aae3eefa30]
  /etc/httpd/modules/mod_mpm_event.so(+0x685a)[0x7fc151df485a]
  /etc/httpd/modules/mod_mpm_event.so(+0x7f44)[0x7fc151df5f44]
  /lib64/libpthread.so.0(+0x7de5)[0x7fc15cd75de5]
  /lib64/libc.so.6(clone+0x6d)[0x7fc15c89bbad]
  </code></pre>
  
  <p>I am not sure if it's a script that's causing the memory leak or if I should just increase the memory limit from my php script. How can I find which script is causing the apache process to crash?</p>
  
  <p>Is there anyway i can find the source of this problem without having to test every php script individually?</p>