Fatal error: Out of memory ... database.php on line 502

Discussion regarding Joomla! Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security and Performance FAQs
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
rosscavins
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Aug 19, 2008 11:48 am

Fatal error: Out of memory ... database.php on line 502

Post by rosscavins » Tue Aug 19, 2008 12:33 pm

((moved from the General Forum))

Using Joomla 1.0.15 for over a year now (upgraded from 1.0.12 more than 8 months ago)

This is a problem I've had before that was solved by upping the PHP memory limit in my php.ini file. It's at 128M now and that's verified by the phpinfo.php file.

The frontend of the site works fine (http://www.scrivel.com) but when I logged into the admin site this morning, this problem popped up again:

Fatal error: Out of memory (allocated 56360960) (tried to allocate 24 bytes) in /home/rcghosti/public_html/scrivel/includes/database.php on line 502

I can't view anything but the main menu.

128M is entirely too much to allocate to a serving a webpage. Most hosts have this capped around 8M. There has got to be another problem somewhere. I can't even get in to install the migration component to migrate to 1.5.6, which I had hoped would solve the problem. I tried removing the Fireboard component record from the jos_components table manually to see if that alleviated some of the memory drain; it didn't work. I did the same with the Thought Cloud module in jos_modules. No go.

I just accessed the admin of this site 2 days ago without incident and nothing has changed except 2 of my writers submitting 2 small articles via a module on the frontend. It's not a large site, surely 232 records in the jos_content table isn't going to cause this error.

Please help, I'm googling everywhere and trying everything I can.

Line 502 is the while statement in this function of database.php:

Code: Select all

	/**
	* Load a list of database objects
	* @param string The field name of a primary key
	* @return array If <var>key</var> is empty as sequential list of returned records.
	* If <var>key</var> is not empty then the returned array is indexed by the value
	* the database key.  Returns <var>null</var> if the query fails.
	*/
	function loadObjectList( $key='' ) {
		if (!($cur = $this->query())) {
			return null;
		}
		$array = array();
		while ($row = mysql_fetch_object( $cur )) {
			if ($key) {
				$array[$row->$key] = $row;
			} else {
				$array[] = $row;
			}
		}
		mysql_free_result( $cur );
		return $array;
	}
Components Installed: !JoomlaComment, EasyGuestbook, JNews, Fireboard, eQuotes, FlexAdvert, JoomlaStats, JoomlaXplorer, M2C, My Content, and the standard Joomla components.

Thanks,
Ross

rosscavins
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Aug 19, 2008 11:48 am

Re: Fatal error: Out of memory ... database.php on line 502

Post by rosscavins » Wed Aug 20, 2008 10:22 am

Is there no one out there who can shed light on this problem?

I'm just logging into the admin and the program is belching on loading database objects from a table in the database.

The prog dies right after showing the # of messages in the admin's mailbox:

Code: Select all

	<td class="menubackgr" align="right">
		<div id="wrapper1">

			<div><a href="index2.php?option=com_messages" style="color: red; text-decoration: none;  font-weight: bold">2 <img src="images/mail.png" align="middle" border="0" alt="Mail" /></a></div><div><br />
<b>Fatal error</b>:  Out of memory (allocated 56360960) (tried to allocate 24 bytes) in <b>/home/rcghosti/public_html/scrivel/includes/database.php</b> on line <b>502</b><br />
After looking at one of my other joomla sites, it seems to be dying when determining how many users are online. Which is funny, since the number is usually 1 or 0, maybe 2 on occasion.

Why would the memory be filling up at this point? Too many menu choices? Loading a few variables shouldn't eat up 128M of RAM.

Someone help?

-Ross
You do not have the required permissions to view the files attached to this post.

rosscavins
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Aug 19, 2008 11:48 am

Re: Fatal error: Out of memory ... database.php on line 502

Post by rosscavins » Thu Aug 21, 2008 12:27 pm

Here's another piece to the puzzle that no one seems able to figure out ..

I created a fresh install in a new directory and moved all the images, modules, components and template over. The admin comes up fine and the frontend comes up fine except for the images (I guess the directory is somehow hard-coded into the {mosimage} tag?).

Now, when I change the first configuration file to point to the 2nd directory's absolute path:
$mosConfig_absolute_path = '/home/rcghosti/public_html/scrivel1';

// $mosConfig_absolute_path = '/home/rcghosti/public_html/scrivel'; ---- is the original line ...

I can view admin. But the second I change that back without the trailing "1", I get the fatal memory error.

Are there no developers lurking around here that know what the program is doing at this point? It seems to be building some kind of huge array that kills the memory because there's possibly an endless loop created. But all that was done to the site between admin logins was to add 2 stories through a frontend module.

Please help!

rosscavins
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Aug 19, 2008 11:48 am

Re: Fatal error: Out of memory ... database.php on line 502

Post by rosscavins » Thu Aug 21, 2008 6:43 pm

As a follow-up ... I found the memory hog ...

JoomlaStats

In the header of the admin, when the program tries to load the modules into an array, JoomlaStats crapped it out. I unpublished it manually in mysql and voila, my admin is back. I installed BSQ Stats and will see how it goes.

I hope someone finding this in the future will find it useful.

-Ross

scrags
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Oct 12, 2008 3:22 pm

Re: Fatal error: Out of memory ... database.php on line 502

Post by scrags » Sun Oct 12, 2008 4:17 pm

Hi Ross

I have Joomla 1.011 on my site and when I try to access the back end I get a similar error message : Fatal error: Out of memory.... database.php on line 487. I believe this is also related to Joomlastats. I see that you solved this by manually unpublishing it in mysql, but I have no idea how. Any chance you could let me know how to do this? :-[

Cheers
David

rosscavins
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Aug 19, 2008 11:48 am

Re: Fatal error: Out of memory ... database.php on line 502

Post by rosscavins » Sun Oct 12, 2008 4:42 pm

You have to go into the mysql database (preferably with phpMyAdmin), go into the modules table, and change the published field. I think you change it to a zero from a one, can't remember.

Hopefully you know someone who can do this for you if you don't know how.

urbanis
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sat Dec 24, 2005 1:04 pm

Re: Fatal error: Out of memory ... database.php on line 502

Post by urbanis » Sat Oct 25, 2008 2:16 pm

Thanks guys. Unpublishing joomlastats in phpAdmin did the trick.
Nice work

User avatar
donmarvin
Joomla! Explorer
Joomla! Explorer
Posts: 379
Joined: Sat Mar 04, 2006 2:27 pm
Location: New York
Contact:

Re: Fatal error: Out of memory ... database.php on line 502

Post by donmarvin » Sat Dec 12, 2009 6:02 pm

Thanks for posting the solution.

Tip: You don't need to go into phpmyadmin to unpublish this module. When you go to module manager (in J 1.5.x), there are 2 tabs on the page -- Site and Admin. Click on "Admin". The mod_stats module is here.
http://www.iTeachMe.com
Online Learning System for Joomla!(R)


Locked

Return to “Performance - 1.0.x”