On Thu, Jul 28, 2011 at 4:29 PM, metalmini <[email protected]> wrote: > Hi guys, > > I am having the hardest time with Zend framwork at the moment. > > All was well and my project was almost finished but while i was browsing > through the application i got a mem size exhausted error on two pages. > > Both of these pages have default zend forms on them. I cant remember what > changes where made so i cant step back and trace the error. > > So now i installed xdebug to get me going again but the trace file is 290 mb > so i cant post it in here.
By trace, do you mean the cachegrind file? What happens when you inspect it yourself? Also, are you sure it's not DB related? E.g. somewhere else you're already reading all records from a giant table into php? Most likely somewhere before the error below. The error below seems to be related to Zend_Db_Table setting up the meta data. Depending on how many models (based on Zend_Db_Table_Abstract) you have, that's a lot of legwork -- on each request. Check out the relevant bits in the manual (setDefaultMetaDataCache): http://framework.zend.com/manual/en/zend.db.table.html I'd probably try to analyze memory usage throughout your code. It's hard to determine like that. But the cachegrind file should allow you to do so This will probably come in useful: http://derickrethans.nl/xdebug-and-tracing-memory-usage.html Till > > How do i find the error that is causing this problem? Can anybody help me > out on this? > > I have a little snippet from the apache error logging: > > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP Fatal error: Allowed > memory size of 134217728 bytes exhausted (tried to allocate 82 bytes) in > /home/somedomain/www/library/Zend/Db/Adapter/Pdo/Mysql.php on line 205, > referer: http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP Stack trace:, > referer: http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 1. {main}() > /home/somedomain/www/index.php:0, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 2. > Zend_Application->run() /home/somedomain/www/index.php:46, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 3. > Zend_Application_Bootstrap_Bootstrap->run() > /home/somedomain/www/library/Zend/Application.php:358, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 4. > Zend_Controller_Front->dispatch($request = *uninitialized*, $response = > *uninitialized*) > /home/somedomain/www/library/Zend/Application/Bootstrap/Bootstrap.php:77, > referer: http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 5. > Zend_Controller_Dispatcher_Standard->dispatch($request = class > Zend_Controller_Request_Http { protected $_paramSources = array (0 => > '_GET', 1 => '_POST'); protected $_requestUri = 'users/voices-register'; > protected $_baseUrl = ''; protected $_basePath = NULL; protected $_pathInfo > = 'users/voices-register'; protected $_params = array ('module' => 'users', > 'controller' => 'voices-register', 'action' => 'index', 'tpl' => > 'modules/users/views/scripts/voicesRegister/index.phtml'); protected > $_rawBody = NULL; protected $_aliases = array (); protected $_dispatched = > TRUE; protected $_module = 'pages'; protected $_moduleKey = 'module'; > protected $_controller = 'index'; protected $_controllerKey = 'controller'; > protected $_action = 'show-other-page'; protected $_actionKey = 'action' }, > $response = class Zend_Controller_Response_Http { protected $_body = array > ('default' => ''); protected $_exceptions = array (); protected $_headers = > array (); protected $_headersRaw = array (); protected $_httpResponseCode = > 200; protected $_isRedirect = FALSE; protected $_renderExceptions = FALSE; > public $headersSentThrowsException = TRUE }) > /home/somedomain/www/library/Zend/Controller/Front.php:946, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 6. > Zend_Controller_Action->dispatch($action = 'showOtherPageAction') > /home/somedomain/www/library/Zend/Controller/Dispatcher/Standard.php:289, > referer: http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 7. > Pages_IndexController->showOtherPageAction() > /home/somedomain/www/library/Zend/Controller/Action.php:513, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 8. > Pages->getPagePath($page_id = 6) > /home/somedomain/www/application/modules/pages/controllers/IndexController.php:319, > referer: http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 9. > Pages->getPage($id = '4') > /home/somedomain/www/application/modules/pages/models/Pages.php:86, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 10. > Pages->__construct($parent_id = '4') > /home/somedomain/www/application/modules/pages/models/Pages.php:41, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 11. > FP_Db_Table->__construct($language = *uninitialized*) > /home/somedomain/www/application/modules/pages/models/Pages.php:18, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 12. > Zend_Db_Table_Abstract->select($withFromPart = *uninitialized*) > /home/somedomain/www/library/FP/Db/Table.php:18, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 13. > Zend_Db_Table_Select->__construct($table = class Pages { protected $_name = > 'pages_en'; protected $_primary = array (1 => 'page_id'); protected > $_rowClass = 'Page'; protected $_blocks = NULL; protected $_parent_id = > NULL; public $_tree = NULL; private ${FP_Db_Table}:positionFieldName = > 'position'; protected $_select = NULL; protected $_language = 'en'; > protected $_hasLanguages = TRUE; public $_paginator = NULL; protected > $_definition = NULL; protected $_definitionConfigName = NULL; protected $_db > = class Zend_Db_Adapter_Pdo_Mysql { protected $_pdoType = 'mysql'; protected > $_numericDataTypes = array (...); protected $_defaultStmtClass = > 'Zend_Db_Statement_Pdo'; protected $_config = array (...); protected > $_fetchMode = 5; protected $_profiler = class Zend_Db_Profiler { ... }; > protected $_defaultProfilerClass = 'Zend_Db_Profiler'; protected > $_connection = class PDO { ... }; protected $_caseFolding = 0; protected > $_autoQuoteIdentifiers = TRUE; protected $_allowSerialization = TRUE; > protected $_autoReconnectOnUnserialize = FALSE }; protected $_schema = NULL; > protected $_cols = NULL; protected $_identity = 1; protected $_sequence = > TRUE; protected $_metadata = array (); protected $_metadataCache = NULL; > protected $_metadataCacheInClass = TRUE; protected $_rowsetClass = > 'Zend_Db_Table_Rowset'; protected $_referenceMap = array (); protected > $_dependentTables = array (); protected $_defaultSource = 'defaultNone'; > protected $_defaultValues = array () }) > /home/somedomain/www/library/Zend/Db/Table/Abstract.php:1009, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 14. > Zend_Db_Table_Select->setTable($table = class Pages { protected $_name = > 'pages_en'; protected $_primary = array (1 => 'page_id'); protected > $_rowClass = 'Page'; protected $_blocks = NULL; protected $_parent_id = > NULL; public $_tree = NULL; private ${FP_Db_Table}:positionFieldName = > 'position'; protected $_select = NULL; protected $_language = 'en'; > protected $_hasLanguages = TRUE; public $_paginator = NULL; protected > $_definition = NULL; protected $_definitionConfigName = NULL; protected $_db > = class Zend_Db_Adapter_Pdo_Mysql { protected $_pdoType = 'mysql'; protected > $_numericDataTypes = array (...); protected $_defaultStmtClass = > 'Zend_Db_Statement_Pdo'; protected $_config = array (...); protected > $_fetchMode = 5; protected $_profiler = class Zend_Db_Profiler { ... }; > protected $_defaultProfilerClass = 'Zend_Db_Profiler'; protected > $_connection = class PDO { ... }; protected $_caseFolding = 0; protected > $_autoQuoteIdentifiers = TRUE; protected $_allowSerialization = TRUE; > protected $_autoReconnectOnUnserialize = FALSE }; protected $_schema = NULL; > protected $_cols = NULL; protected $_identity = 1; protected $_sequence = > TRUE; protected $_metadata = array (); protected $_metadataCache = NULL; > protected $_metadataCacheInClass = TRUE; protected $_rowsetClass = > 'Zend_Db_Table_Rowset'; protected $_referenceMap = array (); protected > $_dependentTables = array (); protected $_defaultSource = 'defaultNone'; > protected $_defaultValues = array () }) > /home/somedomain/www/library/Zend/Db/Table/Select.php:78, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 15. > Zend_Db_Table_Abstract->info($key = *uninitialized*) > /home/somedomain/www/library/Zend/Db/Table/Select.php:100, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 16. > Zend_Db_Table_Abstract->_setupPrimaryKey() > /home/somedomain/www/library/Zend/Db/Table/Abstract.php:973, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 17. > Zend_Db_Table_Abstract->_getCols() > /home/somedomain/www/library/Zend/Db/Table/Abstract.php:889, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 18. > Zend_Db_Table_Abstract->_setupMetadata() > /home/somedomain/www/library/Zend/Db/Table/Abstract.php:849, referer: > http://somedomain.nl/en/contact_info > [Thu Jul 28 16:13:16 2011] [error] [client someip] PHP 19. > Zend_Db_Adapter_Pdo_Mysql->describeTable($tableName = 'pages_en', > $schemaName = NULL) > /home/somedomain/www/library/Zend/Db/Table/Abstract.php:823, referer: > http://somedomain.nl/en/contact_info > > > -- > View this message in context: > http://zend-framework-community.634137.n4.nabble.com/Allowed-memory-size-exhausted-tp3701480p3701480.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- > List: [email protected] > Info: http://framework.zend.com/archives > Unsubscribe: [email protected] > > > -- List: [email protected] Info: http://framework.zend.com/archives Unsubscribe: [email protected]
