Zend Server Out of Memory using CLI

General discussion forum for the Zend Server

Zend Server Out of Memory using CLI

Postby smallred-byu on Tue Apr 25, 2017 10:41 pm

I've been having problems with Zend Server 9.X on Windows 10 (just tried 9.1 and the same problem exists).

Basically when running long running scripts from the CLI, I get the following error, which doesn't take very long to occur.

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in D:\myWorkspaceGit\marriott-zend3\vendor\zendframework\zend-db\src\Adapter\Driver\Pdo\Statement.php on line 239

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in D:\myWorkspaceGit\marriott-zend3\vendor\zendframework\zend-db\src\Adapter\Driver\Pdo\Statement.php on line 239

If I allocate more memory the application just takes longer to fail, but will still fail. The problem does not exist on Zend Server 8.

The one workaround I have found is to disable the ZendExtensionManager.dll in the php.ini file. When I do this the script runs perfectly.

;zend_extension="C:\Program Files (x86)\Zend\ZendServer\lib\ZendExtensionManager.dll"

It seems there is a serious problem with the ZendExtensionManager at least on Windows. The script in question fails after processing only about 10 records, when I disable the ZendExtensionManager it quickly processes about 7000 records.

We have seen other scripts not fail but take forever to run. For instance one of my coworkers ran a script that took about 15 hours to complete. After disabling the ZendExtensionManager, it ran in less than 1 hour. Any suggestions or help would be appreciated. I haven't had the time to confirm if this is a problem on Linux yet.

Thanks
smallred-byu
 
Posts: 7
Joined: Fri Jan 13, 2012 7:00 pm

Re: Zend Server Out of Memory using CLI

Postby zvika on Wed Apr 26, 2017 7:16 am

Hello
Thank you for reporting this. Between Zend Server 8 and 9 versions there is a jump in PHP from 5.5/5.6 to 7.0/7.1, which can be the root cause, including PHP modules such as PDO and its drivers.

We will be able to assist more if you can open a support ticket, provide a sample script, support tool output from the corresponding installation, and try to isolate the component which directly affects the memory allocation (instead of disabling all components with Zend Extension Manager, disable one by one from Administration -> Components under the Admin UI and test).
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 985
Joined: Sun Dec 14, 2008 9:48 am

Re: Zend Server Out of Memory using CLI

Postby smallred-byu on Mon May 01, 2017 9:55 pm

I was able to determine it is related to the following setting under the "Zend Server Z-Ray" component:

zray.collect_backtrace.sql_queries

If I turn that setting to off everything works fine, if I enable it I run out of memory very quickly. The component appears to have a serious memory leak of some kind.

Thanks

Shane
smallred-byu
 
Posts: 7
Joined: Fri Jan 13, 2012 7:00 pm

Re: Zend Server Out of Memory using CLI

Postby smallred-byu on Mon May 01, 2017 10:13 pm

The script that ran for 15 hours still had the same issue until disabling:

zray.collect_functions

Turning that feature off made the time drop to about 15 minutes. So something appears to be wrong with that feature as well.

Thanks

Shane
smallred-byu
 
Posts: 7
Joined: Fri Jan 13, 2012 7:00 pm

Re: Zend Server Out of Memory using CLI

Postby smallred-byu on Mon May 01, 2017 10:21 pm

I tried enabling zray.collect_backtrace.sql_queries and leaving zray.collect_functions disabled and that also fixes my out of memory issue. It appears the problem may be related to zray.collect_functions. Disabling that seems to correct both the performance and out of memory issues I've been experiencing with different scripts.

Thanks

Shane
smallred-byu
 
Posts: 7
Joined: Fri Jan 13, 2012 7:00 pm


Return to Zend Server

Who is online

Users browsing this forum: No registered users and 4 guests