Opened 10 years ago

Closed 9 years ago

#248 closed defect (duplicate)

Memory leak with xcache with constant caching

Reported by: nijel Owned by: moo
Priority: major Milestone: 1.3.2
Component: cacher Version: 1.3.0
Keywords: Cc: Olaf van der Spek <olaf@…>
Application: PHP Version:
Other Exts: SAPI: Irrelevant
Probability: Blocked By:


xcache extension seems to cause memory leak under some conditions just by using opcode cache.

According to some valgrind logs, it looks like the leak is happening through zend_hash_copy, which is used only in few places, but I fail to see where leak could happen.

More information is available in Debian BTS:

Adding original reporter to CC.

Change History (5)

comment:1 Changed 10 years ago by nijel

Also this seems to happen just with CGI build of PHP, not with CLI one.

comment:2 Changed 10 years ago by moo

i'll keep track of this issue

but only malloc() would cause memory leak. most of php extension including use emalloc() all the time. it will be auto free by zend engine. exception is for some persistent data, malloc() is used carefully

cli is not supported. XCache disable itself for php cli

comment:3 Changed 10 years ago by nijel

  • Summary changed from Memory leak with xcache to Memory leak with xcache with constant caching

The problem seems to be caused by --enable-xcache-constant, so there is obviously problem in this part of code.

comment:4 Changed 10 years ago by nijel

Also commenting out following line in xc_sandbox_free seems to "fix" the issue:

TG(zend_constants).pDestructor = NULL;

comment:5 Changed 9 years ago by moo

  • Resolution set to duplicate
  • Status changed from new to closed

thanks for your feedback. this dup of #258 and was fixed

Note: See TracTickets for help on using tickets.