memory problems/crash when viewing relationship tables
15 posts
• Page 1 of 1
I am having trouble with crashing when viewing a table defined by a relationship. My apache log says:
[Wed Mar 14 12:45:34 2007] [notice] caught SIGTERM, shutting down This only happens when the relationship table has more than several hundred matching records, although trying to display any more than 7 or 8 records on the page will trigger the problem. Using xdebug profiling, and requesting only 2 records (so that it does not crash), here is the profiling output (it uses a lot of memory): 10,423,592 193,292 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->parse [] 7,093,341 20 php:internal:php::mysql_query [] 4,789,287 293,512 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getField [] 4,555,958 35,632 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getType [] 3,920,423 10,716 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getTableTableForField [] 3,324,849 313,468 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->_loadValuelistsIniFile [] 3,245,779 8,982,768 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getTableField [] 3,131,907 112,604 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->parseString [] 2,671,789 150,236 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->setValue [] 2,608,915 15,324 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->_hasDelegateFile [] 2,433,626 55,444 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->getValue [] 2,430,504 154,416 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->setValue [] 2,293,346 61,256 /usr/local/lib/dataface-0.6.13r4/PEAR.phpEAR->isError [] 2,228,212 104,360 /usr/local/lib/dataface-0.6.13r4/Dataface/LinkTool.phpataface_LinkTool->buildLink [] 2,203,458 201,788 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->_loadRelatedRecordBlock [] 1,947,395 107,144 /var/www/XXXX/templates_c/dataface/%%08^08F^08FE976E%%Dataface_Main_Template.html.php:include::/var/www/XXXX/templates_c/dataface/%%08^08F^08FE976E%%Dataface_Main_Template.html.php [] 1,765,950 0 php:internal:php::strpos [] 1,750,343 9,467,620 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->absoluteFieldName [] 1,737,653 653,160 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->loadTable [] 1,704,562 9,318,664 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->fieldExists [] 1,698,610 17,472 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getDelegate [] 1,654,904 14,916 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->_delegateFilePath [] 1,375,626 95,100 php:internal:php::explode [] 1,235,723 311,028 /usr/local/lib/dataface-0.6.13r4/Dataface/ActionTool.phpataface_ActionTool->getActions [] 1,186,667 8,499,024 /usr/local/lib/dataface-0.6.13r4/PEAR.phpEAR_Error->PEAR_Error [] 1,168,499 2,368 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getFieldProperty [] 1,150,464 16 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->hasField [] 1,113,676 0 php:internal:php::count [] 1,080,160 1,088 php:internal:php::mysql_connect [] 942,124 8,510,120 /usr/local/lib/dataface-0.6.13r4/PEAR.phpEAR->raiseError [] 939,782 9,278,532 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->toRecord [] 934,348 480 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getRelationship [] 915,939 8,187,272 php:internal:php::debug_backtrace [] 907,644 5,544 php:internal:php::preg_match [] 729,179 156,028 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->setValues [] 706,296 619,068 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->Dataface_Table [] 678,989 0 php:internal:php::is_array [] 670,678 81,432 /usr/local/lib/dataface-0.6.13r4/Dataface/QueryTool.phpataface_QueryTool->getTitles [] 659,393 0 php:internal:php::file_exists [] 609,175 270,844 php:internal:php::mysql_fetch_row [] 578,244 57,664 php:internal:php::is_a [] 564,107 952 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Lexer.php:Lexer->nextToken [] 529,593 1,752 php:internal:php::strtolower [] 525,311 215,116 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->getRelatedRecords [] 491,290 67,396 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->_initValues [] 489,418 9,017,864 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->getAbsoluteValues [] 459,524 161,736 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->setValues [] 445,363 152,824 php:internal:php::array_map [] 439,661 0 php:internal:php::in_array [] 378,847 10,391,000 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedList.phpataface_RelatedList->toHtml [] 364,852 268 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->basePath [] 362,363 42,896 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->fields [] 350,233 9,600,472 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->display [] 340,462 7,604 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->getValueAsString [] 302,854 140 php:internal:php::trim [] 290,177 0 php:internal:php::is_string [] 289,807 42,756 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->_loadFieldsIniFile [] 287,751 8,200 /usr/local/lib/dataface-0.6.13r4/Dataface/SkinTool.phpataface_SkinTool->define_slot [] 287,733 332 php:internal:php::method_exists [] 283,863 7,008 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Compiler/mysql.php:SQL_Compiler_mysql->compileIdent [] 278,068 0 php:internal:php::is_int [] 250,534 30,376 /usr/local/lib/dataface-0.6.13r4/Dataface/QueryTool.phpataface_QueryTool->loadCurrent [] 243,734 49,636 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->_makeEquivalenceLabels_rec [] 239,942 612,444 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->relationships [] 235,342 119,436 php:internal:php::array_keys [] 224,523 4,344 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->postInit [] 219,531 0 php:internal:php::mysql_select_db [] 210,368 313,468 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->valuelists [] 189,813 3,724 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->isBlob [] 188,822 50,100 php:internal:php::parse_ini_file [] 188,168 384 php:internal:php::urlencode [] 186,239 532 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->displayBlock [] 178,249 379,888 /usr/local/lib/dataface-0.6.13r4/config.inc.php:import [] 178,125 37,260 /usr/local/lib/dataface-0.6.13r4/Dataface/PermissionsTool.phpataface_PermissionsTool->addPermissions [] 172,159 1,668 php:internal:php::eregi [] 171,450 78,296 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->getForeignKeyValues [] 169,112 9,360,900 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->display [] 167,432 39,152 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getPermissions [] 167,136 4,352 /var/www/XXXX/templates_c/dataface/%%81^815^815CCA65%%Dataface_NavMenu.html.php:include::/var/www/XXXX/templates_c/dataface/%%81^815^815CCA65%%Dataface_NavMenu.html.php [] 166,330 0 php:internal:php::sizeof [] 164,874 8,808 /usr/local/lib/dataface-0.6.13r4/lib/Smarty/Smarty.class.php:Smarty->_parse_resource_name [] 162,692 31,116 /usr/local/lib/dataface-0.6.13r4/Dataface/PermissionsTool.phpataface_PermissionsTool->checkPermission [] 157,540 523,856 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->_normalizeColumns [] 157,396 20,968 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->testCondition [] 155,066 7,112 /usr/local/lib/dataface-0.6.13r4/dataface-public-api.php:df_block [] 149,450 72 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->_translateRangeToBlocks [] 145,991 248 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getBlockContent [] 144,765 34,388 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->getPermissions [] 143,436 14,520 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->getRecord [] 137,912 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->getQuery [] 136,010 58,300 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.php(991) : eval()'d code:eval [] 131,242 1,256 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Lexer.php:Lexer->lex [] 129,425 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->setFlag [] 129,053 10,795,048 /usr/local/lib/dataface-0.6.13r4/lib/Smarty/Smarty.class.php:Smarty->fetch [] 128,728 6,028 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->parseString [] 128,525 7,112 /usr/local/lib/dataface-0.6.13r4/Dataface/SkinTool.phpataface_SkinTool->block [] 127,587 104,844 /usr/local/lib/dataface-0.6.13r4/Dataface/ConfigTool.phpataface_ConfigTool->loadConfigFromINI [] 125,838 10,004 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getFieldPermissions [] 125,726 2,768 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->isText [] 116,722 50,260 /usr/local/lib/dataface-0.6.13r4/Dataface/PermissionsTool.phpataface_PermissionsTool->getPermissions [] 116,491 25,356 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->getResultSet [] 114,949 61,832 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->_makeEquivalenceLabels [] 114,139 210,356 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->Dataface_Record [] 112,769 12,088 /usr/local/lib/dataface-0.6.13r4/config.inc.php:stripslashes_array [] 112,582 5,040 php:internal:php::array_pop [] 111,200 47,752 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->url [] 110,910 41,120 /usr/local/lib/dataface-0.6.13r4/PEAR.phpEAR->getStaticProperty [] 110,143 3,660 /usr/local/lib/dataface-0.6.13r4/lib/Smarty/internals/core.get_include_path.php:smarty_core_get_include_path [] 106,609 120 php:internal:php::floatval [] 106,098 607,240 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->_init [] 106,066 135,340 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->Dataface_RelatedRecord [] 105,624 154,872 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_RelationshipIterator->current [] 100,359 14,560 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Compiler.php:SQL_Compiler->compileSelect [] 98,507 752 php:internal:php::uasort [] 93,798 37,936 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->getPermissions [] 93,722 3,812 /usr/local/lib/dataface-0.6.13r4/SQL/Parser/wrapper.php:SQL_Parser_wrapper->getTableName [] 93,039 157,296 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getActions [] 92,667 10,984 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->getOrderColumn [] 92,421 1,200 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->isChar [] 90,277 15,936 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->setMetaDataValue [] 89,881 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->relativeFieldName [] 89,021 150,844 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Parser.php:SQL_Parser->SQL_Parser [] 86,531 51,328 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->getSQL [] 85,694 100 php:internal:php::phpversion [] 84,039 4,900 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->isDate [] 83,907 7,696 /usr/local/lib/dataface-0.6.13r4/Dataface/SkinTool.phpataface_SkinTool->_get_compile_path [] 82,160 13,848 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->getRelationshipIterator [] 78,157 35,916 /usr/local/lib/dataface-0.6.13r4/Dataface/Error.phpataface_Error->printStackTrace [] 76,788 104,588 /usr/local/lib/dataface-0.6.13r4/lib/Smarty/Smarty.class.php:Smarty->_smarty_include [] 75,603 99,140 php:internal:php::array_merge [] 75,031 0 php:internal:php::is_object [] 74,574 0 php:internal:php::is_null [] 74,180 2,136 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->filterUrl [] 74,021 40,876 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->setSnapshot [] 72,518 7,596 php:internal:php::substr [] 72,054 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table::loadTable [] 71,957 0 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->isDirty [] 71,802 9,514,136 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->preview [] 70,772 10,172 php:internal:php::function_exists [] 69,783 6,380 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->getInstance [] 67,364 3,304 /usr/local/lib/dataface-0.6.13r4/SQL/Parser/wrapper.php:SQL_Parser_wrapper->resolveColumnName [] 67,296 14,588 /usr/local/lib/dataface-0.6.13r4/SQL/Parser/wrapper.php:SQL_Parser_wrapper->addMetaDataColumn [] 66,896 7,200 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_RelationshipIterator->Dataface_RelationshipIterator [] 66,873 2,724 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Compiler.php:SQL_Compiler->compileFunctionOpts [] 65,396 0 php:internal:php::array_key_exists [] 63,569 5,028 /usr/local/lib/dataface-0.6.13r4/Dataface/QueryBuilder.phpataface_QueryBuilder->_where [] 62,338 168,720 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->getRelatedRecord [] 62,204 2,448 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getCharFields [] 61,643 932 /usr/local/lib/dataface-0.6.13r4/lib/Smarty/Smarty.class.php:Smarty->_get_auto_filename [] 60,658 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->clearFlags [] 60,356 17,680 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->getValues [] 57,523 80 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Lexer.php:Lexer->get [] 56,870 7,180,660 php:internal:php:b_start [] 53,396 99,696 /usr/local/lib/dataface-0.6.13r4/Dataface/PermissionsTool.phpataface_PermissionsTool->getRolePermissions [] 52,643 236 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->isPassword [] 51,703 3,980 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Compiler.php:SQL_Compiler->compileFunction [] 50,065 10,344 /usr/local/lib/dataface-0.6.13r4/Dataface/Error.phpataface_Error->stringRepresentation [] 49,610 416 php:internal:php::defined [] 49,452 488 /usr/local/lib/dataface-0.6.13r4/Dataface/ActionTool.phpataface_ActionTool->_compareActions [] 49,263 0 php:internal:php::array_shift [] 48,944 37,688 /usr/local/lib/dataface-0.6.13r4/Dataface/PermissionsTool.phpataface_PermissionsTool->view [] 48,101 111,536 /usr/local/lib/dataface-0.6.13r4/Dataface/ConfigTool.phpataface_ConfigTool->loadConfig [] 47,717 3,528 php:internal:php::str_replace [] 47,345 147,484 /var/www/XXXX/templates_c/dataface/%%E9^E92^E92E6ABF%%Dataface_Record_Template.html.php:include::/var/www/XXXX/templates_c/dataface/%%E9^E92^E92E6ABF%%Dataface_Record_Template.html.php [] 47,175 84,088 /usr/local/lib/dataface-0.6.13r4/Dataface/ResultController.phpataface_ResultController->getLinkHtml [] 46,670 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->getRelationshipRange [] 45,554 0 php:internal:php::strlen [] 45,108 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->getDelegate [] 43,629 5,608 /usr/local/lib/dataface-0.6.13r4/SQL/Parser/wrapper.php:SQL_Parser_wrapper->unresolveColumnName [] 43,529 3,156 /usr/local/lib/dataface-0.6.13r4/lib/Smarty/Smarty.class.php:Smarty->_fetch_resource_info [] 43,302 12,568 /usr/local/lib/dataface-0.6.13r4/SQL/Parser/wrapper.php:SQL_Parser_wrapper->SQL_Parser_wrapper [] 42,579 10,524,940 /var/www/XXXX/templates_c/dataface/%%4F^4F5^4F541920%%Dataface_Related_Records_List.html.php:include::/var/www/XXXX/templates_c/dataface/%%4F^4F5^4F541920%%Dataface_Related_Records_List.html.php [] 42,555 54,608 /usr/local/lib/dataface-0.6.13r4/Dataface/ActionTool.phpataface_ActionTool->_loadActionsINIFile [] 42,107 8,072 /usr/local/lib/dataface-0.6.13r4/Dataface/Error.phpataface_Error::stringRepresentation [] 42,073 40 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->mandatoryFields [] 41,389 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->isContainer [] 40,979 -7201604 php:internal:php:b_end_clean [] 40,650 0 php:internal:php::is_readable [] 39,449 154,872 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_RelationshipIterator->next [] 39,107 372 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->strval [] 38,149 3,260 /usr/local/lib/dataface-0.6.13r4/lib/Smarty/Smarty.class.php:Smarty->_is_compiled [] 38,036 1,488 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->isLoaded [] 37,362 270,460 php:internal:php:b_get_contents [] 37,293 114,580 /usr/local/lib/dataface-0.6.13r4/Dataface/ActionTool.phpataface_ActionTool->getAction [] 37,215 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->getId [] 37,025 5,556 /var/www/XXXX/templates_c/dataface/%%A7^A71^A7170600%%Dataface_ActionsMenu.html.php:include::/var/www/XXXX/templates_c/dataface/%%A7^A71^A7170600%%Dataface_ActionsMenu.html.php [] 36,868 63,372 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->getDomainSQL [] 35,271 32,664 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->checkPermission [] 35,033 1,256 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Parser.php:SQL_Parser->getTok [] 33,974 0 php:internal:php:rd [] 33,483 6,564 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->isYesNoValuelist [] 32,727 11,812 /usr/local/lib/dataface-0.6.13r4/config.inc.php:require_once::/usr/local/lib/dataface-0.6.13r4/config.inc.php [] 32,096 4,332 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Parser.php:SQL_Parser->parseSelect [] 30,841 2,872 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->getDestinationTables [] 29,727 1,876 /usr/local/lib/dataface-0.6.13r4/lib/Smarty/internals/core.load_plugins.php:smarty_core_load_plugins [] 29,431 0 php:internal:php::ctype_alnum [] 28,488 0 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->setFlag [] 28,231 641,228 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getRelationshipsAsActions [] 27,939 39,452 /usr/local/lib/dataface-0.6.13r4/Dataface/PermissionsTool.phpataface_PermissionsTool->getInstance [] 27,288 18,440 /usr/local/lib/dataface-0.6.13r4/Dataface/SkinTool.phpataface_SkinTool->actions_menu [] 27,125 8,080 /usr/local/lib/dataface-0.6.13r4/Dataface/ResultController.phpataface_ResultController->_buildLink [] 26,769 832 /usr/local/lib/dataface-0.6.13r4/SQL/Parser/wrapper.php:SQL_Parser_wrapper->getTableAlias [] 26,339 68,788 php:internal:php::mysql_fetch_array [] 25,603 29,508 /usr/local/lib/dataface-0.6.13r4/Dataface/SkinTool.phpataface_SkinTool->Dataface_SkinTool [] 25,478 1,540 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Parser.php:SQL_Parser->parseSearchClause [] 25,068 611,384 /usr/local/lib/dataface-0.6.13r4/Dataface/Relationship.phpataface_Relationship->Dataface_Relationship [] 21,654 0 /usr/local/lib/dataface-0.6.13r4/Dataface/RelatedRecord.phpataface_RelatedRecord->getValues [] 20,791 6,844 /usr/local/lib/dataface-0.6.13r4/Dataface/QueryBuilder.phpataface_QueryBuilder->Dataface_QueryBuilder [] 20,625 11,633,348 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->handleRequest [] 20,609 616 /usr/local/lib/dataface-0.6.13r4/Dataface/QueryBuilder.phpataface_QueryBuilder->_secure [] 20,547 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->graftedFields [] 20,514 2,732 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.phpataface_Table->getValuelist [] 20,420 10,377,376 /usr/local/lib/dataface-0.6.13r4/Dataface/SkinTool.phpataface_SkinTool->related_list [] 19,822 7,868 /usr/local/lib/dataface-0.6.13r4/Dataface/ResultController.phpataface_ResultController->getContentsList [] 19,351 17,120 /usr/local/lib/dataface-0.6.13r4/Dataface/SkinTool.phpataface_SkinTool->actions [] 19,114 2,512 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->toJS [] 18,813 11,304 /var/www/XXXX/templates_c/dataface/%%71^71F^71FDC40F%%RecordNavMenu.html.php:include::/var/www/XXXX/templates_c/dataface/%%71^71F^71FDC40F%%RecordNavMenu.html.php [] 18,552 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_RelationshipIterator->hasNext [] 18,257 9,088 /usr/local/lib/dataface-0.6.13r4/Dataface/ActionTool.phpataface_ActionTool->addAction [] 18,035 0 /usr/local/lib/dataface-0.6.13r4/Dataface/Record.phpataface_Record->_relatedRecordBlockLoaded [] 17,978 5,456 php:internal:php::unserialize [] 17,967 75,620 /var/www/XXXX/templates_c/dataface/%%2A^2AB^2AB5C15C%%Dataface_Details_Controller.html.php:include::/var/www/XXXX/templates_c/dataface/%%2A^2AB^2AB5C15C%%Dataface_Details_Controller.html.php [] 17,626 776 /usr/local/lib/dataface-0.6.13r4/lib/SQL/Parser.php:SQL_Parser->cloneDialect [] 17,224 12,540 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application::getInstance [] 17,215 8,780 php:internal:php::preg_replace [] 17,010 48 /usr/local/lib/dataface-0.6.13r4/lib/Smarty/Smarty.class.php:Smarty->get_template_vars [] 16,916 784 php:internal:php::urldecode [] 16,679 59,368 /usr/local/lib/dataface-0.6.13r4/Dataface/Table.php:require_once::/usr/local/lib/dataface-0.6.13r4/Dataface/Table.php [] 16,446 39,468 php:internal:php::serialize [] 16,162 0 php:internal:php::floor [] 16,108 0 php:internal:php::intval [] 16,026 496 /usr/local/lib/dataface-0.6.13r4/Dataface/LinkTool.phpataface_LinkTool->getMask [] 15,679 6,064 php:internal:php::implode [] 15,094 11,180 /usr/local/lib/dataface-0.6.13r4/Dataface/Application.phpataface_Application->Dataface_Application [] When I turn on xdebug and set the timeout such that the script times out instead of crashing, here is the backtrace (trying to display the first 30 of a couple hundred records): Call Stack # Time Memory Function Location 1 0.0080 37732 {main}( ) ../index.php:0 2 0.1720 99228 Dataface_Application->display( ) ../index.php:25 3 0.1731 100300 Dataface_Application->handleRequest( ) ../Application.php:1208 4 0.9855 493752 dataface_actions_related_records_list->handle( ) ../Application.php:805 5 2.5002 1115432 df_display( ) ../related_records_list.php:21 6 2.5157 1204208 Dataface_SkinTool->display( ) ../dataface-public-api.php:236 7 2.5159 1204288 Smarty->display( ) ../SkinTool.php:256 8 2.5160 1204288 Smarty->fetch( ) ../Smarty.class.php:1101 9 2.5220 1209776 include( '/var/www/XXXX/templates_c/dataface/%%4F^4F5^4F541920%%Dataface_Related_Records_List.html.php' ) ../Smarty.class.php:1251 10 2.5281 1377236 Dataface_SkinTool->related_list( ) ../%%4F^4F5^4F541920%%Dataface_Related_Records_List.html.php:12 11 2.5320 1380920 Dataface_RelatedList->toHtml( ) ../SkinTool.php:692 12 30.8158 49648084 Dataface_Record->preview( ) ../RelatedList.php:383 13 30.8158 49648084 Dataface_Record->display( ) ../Record.php:1204 14 30.8160 49648084 Dataface_Record->getRelatedRecord( ) ../Record.php:1060 15 30.8188 49648596 Dataface_RelationshipIterator->next( ) ../Record.php:676 16 30.8188 49648596 Dataface_RelationshipIterator->current( ) ../Record.php:1981 17 30.8190 49648596 Dataface_RelatedRecord->Dataface_RelatedRecord( ) ../Record.php:1987 18 30.8193 49648596 Dataface_RelatedRecord->setValues( ) ../RelatedRecord.php:97 19 30.8470 49651572 Dataface_RelatedRecord->setValue( ) ../RelatedRecord.php:215 If you have any suggestions, please let me know, Hal
Can you provide the relevant table/relationship info. e.g.: Table schema relationships.ini file Anything else that could be relevant. Version of mysql/php etc..
The Web server is running Debian, libapache2-mod-php5 version 5.2.0-10. MySQL client library version is 5.0.32-7, and the MySQL server version (on the database server) is 5.1.14.
I cannot send the complete schema, but the following is an affected subset (please let me know if you would like anything else). If I am viewing an E-mail domain, and I click on the "E-mail users" tab, if the total number of results is greater than several hundred, then the process will either run out of memory or just crash. The amount of memory used seems to vary as the number of displayed results (for example, if viewing 8 results may crash the process, as will any number over 8, but viewing any number less than 8 may be ok). The amount of memory used (according to xdebug) seems to grow as the number of viewed results increases but it seems to use a huge amount of memory for what it is doing. cat mail_domains/fields.ini [id] widget:type = "hidden" visibility:list = hidden [group_id] widget:label = "Owning Customer" widget:type = select vocabulary = groups [name] widget:label = "Domain Name" [active] widget:label = "Active" widget:description = "Is this domain active" cat mail_domains/valuelists.ini [groups] __sql__ = "SELECT id, name FROM groups" cat mail_domains/relationships.ini [mail_users] mail_users.mail_domain_id = "$id" action:label = "E-mail Users" cat mail_users/fields.ini [id] widget:type = "hidden" visibility:list = hidden [mail_domain_id] widget:label = "E-mail Domain" widget:type = select vocabulary = domains [username] widget:label = "Username" [password] widget:label = "Password" [encrypted] widget:label = "Encrypted Password" widget:description = "Is the password stored in encrypted form" [quota] widget:label = "Quota" [first_name] widget:label = "First Name" [last_name] widget:label = "Last Name" [title] widget:label = "Title" [addr1] widget:label = "Address Line 1" [addr2] widget:label = "Address Line 2" [city] widget:label = "City" [state] widget:label = "State" [zip] widget:label = "ZIP Code" [country] widget:label = "Country" [active] widget:label = "Active" widget:description = "Is this user active" [notes] widget:label = "Notes" widget:type = "htmlarea" visibility:list = hidden cat mail_users/valuelists.ini [domains] __sql__ = "SELECT id, name FROM mail_domains" cat groups/fields.ini [id] widget:type = "hidden" visibility:list = hidden [name] widget:label = "Name" [active] widget:label = "Active" widget:description = "Is this customer active" [notes] widget:label = "Notes" widget:type = "htmlarea" visibility:list = hidden [parent_group_id] widget:label = "Parent Customer" widget:type = select vocabulary = groups cat groups/valuelists.ini [groups] __sql__ = "SELECT id, name FROM groups" cat groups/relationships.ini (references to other tables omitted) [mail_domains] mail_domains.group_id = "$id" action:label = "E-mail Domains" mysql> show create table mail_domains; CREATE TABLE `mail_domains` ( `id` int(11) NOT NULL AUTO_INCREMENT, `group_id` int(11) NOT NULL, `name` varchar(128) NOT NULL, `active` enum('N','Y') NOT NULL DEFAULT 'Y', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), KEY `group_id` (`group_id`), CONSTRAINT `mail_domains_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 show create table mail_users; CREATE TABLE `mail_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mail_domain_id` int(11) NOT NULL, `username` varchar(64) NOT NULL, `password` varchar(128) NOT NULL, `encrypted` enum('N','Y') NOT NULL DEFAULT 'N', `quota` int(11) NOT NULL, `first_name` varchar(64) DEFAULT NULL, `last_name` varchar(64) DEFAULT NULL, `title` varchar(64) DEFAULT NULL, `addr1` varchar(128) DEFAULT NULL, `addr2` varchar(128) DEFAULT NULL, `city` varchar(64) DEFAULT NULL, `state` varchar(64) DEFAULT NULL, `zip` varchar(16) DEFAULT NULL, `country` varchar(64) DEFAULT NULL, `active` enum('N','Y') NOT NULL DEFAULT 'Y', `notes` text, PRIMARY KEY (`id`), UNIQUE KEY `mail_domain_id` (`mail_domain_id`,`username`), CONSTRAINT `mail_users_ibfk_1` FOREIGN KEY (`mail_domain_id`) REFERENCES `mail_domains` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 show create table groups; CREATE TABLE `groups` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(64) NOT NULL, `active` enum('N','Y') NOT NULL DEFAULT 'Y', `notes` text, `parent_group_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `parent_group_id` (`parent_group_id`), CONSTRAINT `groups_ibfk_1` FOREIGN KEY (`parent_group_id`) REFERENCES `groups` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Thanks again, Hal
A small update, I just received this error when viewing a relationship. This time the total number of matching records was only 8 (so much for my theory about it taking several hundred matching records). The error is:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4104 bytes) in /usr/local/lib/dataface-0.6.13r4/Dataface/Record.php on line 1443 Perhaps this is a hint, Thanks again, Hal
Another small update; The error seems to trigger the following error message in the apache log:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 52 bytes) in /usr/local/lib/dataface-0.6.13r4/PEAR.php on line 863 That line reads: $this->backtrace = debug_backtrace(); Thanks again, Hal
One thing is: how big are the tables that are being used in the valuelists?Ê e.g. The groups and the mail_domains tables? Currently valuelist values are loaded in completely every call... for very large valuelists this may be prohibitive... but it shouldn't be a problem until you start getting into thousands of values in the valuelist. Another thing to check is: is the memory exploding (i.e. if you set the memory limit to say 100 megs, does it still overflow?) or is it just hovering around the limit? -Steve
As far as I can tell, the memory is exploding. I set the memory limit to 96 megs, and that "fixed" a couple of them, but others still crash.
Do you mean that in order to display a list of records with valuelists defined by an SQL query, that the query is executed for every record to be displayed, or just that the query result is duplicated in memory for every record? Here are the current table sizes. mysql> select count(*) from groups; +----------+ | count(*) | +----------+ | 136 | +----------+ 1 row in set (0.00 sec) mysql> select count(*) from mail_domains; +----------+ | count(*) | +----------+ | 52 | +----------+ 1 row in set (0.00 sec) mysql> select count(*) from mail_users; +----------+ | count(*) | +----------+ | 3296 | +----------+ 1 row in set (0.03 sec) Thanks again, Hal
On valuelists: If you are displaying a list of records whose columns require a valuelist to display the value, (Only once though - for the first record).Ê Subsequent records will just use the valuelist values that have already been loaded.Ê Future solutions for "lazy" valuelists that aren't loaded into memory will eventually be added - That said, this doesn't appear to be a valuelist problem... but it is difficult to say on this end what Which relationship are you trying to view when this happens?Ê Does it happen for all tables / all relationships - or just one? Please stick at it so we can find the problem - there is a solution, but it may not present itself until all the facts are on the table. Best regards
I am getting a similar problem on LCMSWhen I try to list the sidebars related to a page, I get an out of memory error (it's only started to do this in the last couple of weeks):
----------------------------------------------------------------------------- Found 5 Records in relationship sidebars Now Showing 1 to 5 (Display Records per page) * Export CSV Export CSV Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 bytes) in /home/archomai/dataface0p6p13/PEAR.php on line 863 Id Title Content Link url Link label Pageid Sidebarid Sidebar order 1 News 1 1 ------------------------------------------------------------------------- The number of bytes in the "tried to allocate" part changes and the page is displayed as text, not formatted. I can edit the sidebars and pages tables from their own tabs without problems. I am running v0.6.13 Any thoughts? Thanks Neil
Hi Neil,
Try increasing your allowed memory to 16 megs. PHP usually uses about 7 megs on its own before loading any of the Dataface stuff, so the 8 meg limit isn't difficult to push through. You can do this by adding:
to the config.inc.php file (or pretty much anywhere that you know will get executed). Best regards Steve
PHP Fatal Error: Allowed memory size ofI just recently encountered that..
and I went through all the conf's for increasing memory limits & no matter what I did... I kept getting the error. I think I went back through, upgraded PEAR, and also made sure the my PHP binary was the correct one in all the usual places. /usr/local/bin; usr/bin etc.
Doesn't seem to be the problem SteveTried it - got another two records listed before it crashed out on 16Mb.
Will LCMS run with v0.7? Thanks Neil
I suspect you may be right DanwHowever, I just want to check with Steve whether LCMS runs ok on v0.7.
Thanks for your suggestion. Neil
That's interesting. LCMS should work with 0.7.
I did encounter a similar bug a while back intermittently... I fixed it - but I don't think I have even released the fix yet, even as of 0.7. I really want to release the latest source, but there are some nagging issues that I need to take care of to ensure backward compatibility.
Thanks SteveI'll give 0.7 a try and see what happens. Might take a while as I am travelling on business for the next two weeks.
Neil
15 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 10 guests |