Results 1 to 7 of 7
  1. #1

    Default How to determine if I have runaway memory usage

    I am having an issue with the following:
    PHP Fatal error: Out of memory (allocated 37748736) (tried to allocate 16384 bytes) in ....../public_html/includes/classes/db/mysql/query_factory.php on line 44

    I am trying to figure out exactly what is causing the extreme memory usage as I have 1028mb set of PHP in the server settings which I believe to be quite large.

    For this reason I think its possible a plugin I am using which could be causing the error.

    What would be the best method for determining the memory problem

    Thanks!

  2. #2
    Join Date
    Feb 2014
    Location
    Germany
    Posts
    121
    Plugin Contributions
    0

    Default Re: How to determine if I have runaway memory usage

    if possible start watching the php process with top / htop

  3. #3

    Default Re: How to determine if I have runaway memory usage

    Thanks, I will take a look!

    I am trying to understand more of the log error file
    PHP Fatal error: Out of memory (allocated 37748736) (tried to allocate 16384 bytes)

    If I convert this value to Megabytes we get:
    PHP Fatal error: Out of memory (allocated 37.748736) (tried to allocate 0.016384 bytes)

    If my php.ini is currently set to 1024MB how im not sure how I am getting this fatal error as I believe there should be memory left over?

    Can someone explain where I am going wrong with my thoughts?

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,699
    Plugin Contributions
    11

    Default Re: How to determine if I have runaway memory usage

    Quote Originally Posted by DannyVarley View Post
    ....Can someone explain where I am going wrong with my thoughts?
    trying to fix this error by expanding available memory is never a good idea.

    fixing the script that is using memory without care is always a better solution.

    that is what is wrong with your thoughts.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5

    Default Re: How to determine if I have runaway memory usage

    Thanks Carl,

    I totally agree however Im not really an experienced developer so I have come to the forum to see if I can gain some help! See my initial question:
    "What would be the best method for determining the memory problem?"

    Expanding the memory was something that was done by my host after trying to get help from them for the same issue. I am aware that I have an issue with a script somewhere but how would be the best method of finding the culprit?

    Cheers

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,586
    Plugin Contributions
    88

    Default Re: How to determine if I have runaway memory usage

    That out-of-memory condition can be caused by a never-ending loop. The most common is a while loop that fails to increment the condition it's looking to finish.

    For example:

    while (!$query_results->EOF) {
    //- Do stuff
    $query_results->MoveNext();
    }

    ... but missing the $query_results->MoveNext, so that the loop never reaches its completion.

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,586
    Plugin Contributions
    88

    Default Re: How to determine if I have runaway memory usage

    The root-cause of this issue (IMO) was a collection of known attackers (as identified by https://ipdata.co) hammering on the site.

    The issue was exacerbated by the site's setting of the SQL_CACHE_METHOD to 'database', so that every hit was resulting in a database insert/update.

 

 

Similar Threads

  1. Calendar for specials/salemaker is a runaway
    By DarkAngel in forum Setting Up Specials and SaleMaker
    Replies: 3
    Last Post: 3 Jun 2018, 08:09 PM
  2. Ever increasing Physical Memory Usage since switching hosts
    By Ted Grapler in forum General Questions
    Replies: 14
    Last Post: 27 Jul 2017, 06:25 PM
  3. URGENT: too much CPU and memory usage after upgrade
    By dealbyethan.com in forum General Questions
    Replies: 9
    Last Post: 3 Oct 2010, 01:56 PM
  4. How to determine $box_id
    By thomasw98 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 17 Aug 2007, 11:20 PM
  5. Memory Usage....
    By hmdesigns in forum General Questions
    Replies: 4
    Last Post: 5 Jun 2006, 05:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR