Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
964 views
in Q2A Core by
Hi. Please help. How fix this bugs?

Q2A Version 1.6.3

PHP Fatal error:  Allowed memory size of 134217728 bytes
exhausted (tried to allocate 32 bytes) in /usr/home/domain/public_html/qa-include/qa-db.php on line 647

PHP Fatal error:  Allowed memory size of 536870912 bytes
exhausted (tried to allocate 4194304 bytes) in /usr/home/domain/public_html/qa-include/qa-app-options.php on
line 166

2 Answers

+1 vote
by
This is not a bug. It means there is insufficient memory in your hosting account. Ask your host for a RAM upgrade.
by
I am an administrator of my server with this site. And I set memory_limit = 1024M in php.ini but this is not normal. If this value is lower then the site falls. :-(
0 votes
by
edited by

My advice.

1st: you should investigate record count of qa_options table with phpMyAdmin, etc.

Case of very many records in qa_options table:

  1. It will be necessary to delete unnecessary records with phpMyAdmin, etc.

Case of few records in qa_options table:

  1. Remove all third party plugin temporarily. And, confirm reproduction of phenomenon.
  2. Restore third party plugin one by one. And, confirm reproduction of phenomenon.

Other convenient methods:

qa-config.php::QA_DEBUG_PERFORMANCE: false >> true

In addtion, if you hack Q2A core, you may not discover cause by this method...

Technical information > @Scott (Sorry, I mistake handle name):

Table data (include records of qa_options table) increases by addition of plugin basically. Even if you delete plugin, added table (include records of qa_options table) does not decrease. This may be a bug of Q2A core and plugins (This opinion varies among people). In future, if Q2A core have namespace for every plugin, Q2A core will have automatic database maintenance feature.

by
Sorry. but  I do not understand programming.

I set qa-config.php::QA_DEBUG_PERFORMANCE: false >> true
And we can see this:

Total – 5346.8ms (100%) – PHP 4929.3ms (92%), MySQL 546.3ms (10%), Other 0.0ms (0%) – 52 PHP files, 3 DB queries, 83575k RAM (100%)

Setup – 5328.6ms (99%) – PHP 4910.9ms (91%), MySQL 546.0ms (10%), Other 0.0ms (0%) – 20 PHP files, 1 DB query, 80560k RAM (96%)
Control – 7.9ms (0%) – PHP 7.7ms (0%), MySQL 0.4ms (0%), Other 0.0ms (0%) – 26 PHP files, 2 DB queries, 1478k RAM (1%)
View – 4.9ms (0%) – PHP 5.1ms (0%), MySQL 0.0ms (0%), Other 0.0ms (0%) – 4 PHP files, 0 DB queries, 569k RAM (0%)
Theme – 5.3ms (0%) – PHP 5.1ms (0%), MySQL 0.0ms (0%), Other 0.2ms (0%) – 2 PHP files, 0 DB queries, 964k RAM (1%)


(SELECT 'options' AS selectkey, title, content FROM qa_options) UNION ALL (SELECT 'time', 'db_time', UNIX_TIMESTAMP(NOW()))

545.96 ms - 263463 rows - 3 columns

(SELECT 'pending_loggedinuser' AS selectkey, qa_users.userid, passsalt, HEX(passcheck) AS passcheck, email, level, emailcode, handle, UNIX_TIMESTAMP(created) AS created, sessioncode, sessionsource, flags, UNIX_TIMESTAMP(loggedin) AS loggedin, INET_NTOA(loginip) AS loginip, UNIX_TIMESTAMP(written) AS written, INET_NTOA(writeip) AS writeip, BINARY avatarblobid AS avatarblobid, avatarwidth, avatarheight, points, wallposts, NULL AS noticeid, NULL AS content, NULL AS format, NULL AS tags, NULL AS type, NULL AS categorybackpath, NULL AS action, NULL AS period, NULL AS count, NULL AS entityid, NULL AS entitytype, NULL AS pageid, NULL AS title, NULL AS permit, NULL AS nav, NULL AS position, NULL AS heading, NULL AS widgetid, NULL AS place FROM qa_users LEFT JOIN qa_userpoints ON qa_userpoints.userid=qa_users.userid WHERE qa_users.userid='1') UNION ALL (SELECT 'pending_notices', NULL, NULL, NULL, NULL, NULL, NULL, NULL, UNIX_TIMESTAMP(created), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, noticeid, content, format, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_usernotices WHERE userid='1' ORDER BY created) UNION ALL (SELECT 'pending_favoritenonqs', IF (entitytype='U', entityid, NULL), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_words.word, entitytype, qa_categories.backpath, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userfavorites LEFT JOIN qa_words ON entitytype='T' AND wordid=entityid LEFT JOIN qa_categories ON entitytype='C' AND categoryid=entityid WHERE userid='1' AND entitytype!='Q') UNION ALL (SELECT 'pending_userlimits', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, action, period, count, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userlimits WHERE userid='1') UNION ALL (SELECT 'pending_userlevels', NULL, NULL, NULL, NULL, level, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, entityid, entitytype, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userlevels WHERE userid='1') UNION ALL (SELECT 'pending_iplimits', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, action, period, count, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_iplimits WHERE ip=COALESCE(INET_ATON('37.57.98.102'), 0)) UNION ALL (SELECT 'pending_navpages', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, flags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pageid, title, permit+0, nav, position, heading, NULL, NULL FROM qa_pages WHERE nav IN ('B','M','O','F') ORDER BY position) UNION ALL (SELECT 'pending_widgets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, title, NULL, NULL, position, NULL, widgetid, place FROM qa_widgets ORDER BY position)

0.11 ms - 10 rows - 40 columns

SHOW TABLES

0.27 ms - 31 rows - 1 column
by
I feel numerical value below is abnormal. Probably it will be caused by the enlargement of qa_options table.

SELECT... FROM qa_options... >>> 545.96 ms - 263463 rows

After you backed up DB, and It will be necessary to delete unnecessary records of qa_options table. I cannot judge the record which you should delete. I hope that you can discover some specific state by investigating qa_options table thoroughly.
...