Topic on Project:Support desk

[Error] [AutoLoader.php] Out of memory!

24
Qops1981 (talkcontribs)

Hey all,

Sorry in advance.. I tried to clean up my wiki formatting as much as I could :-/.

EC2 m1.medium
NGINX
MediaWiki 1.22.0
PHP 5.3.28 (fpm-fcgi)
PHP memory_limit 128M 128M - (UP from 64M)
MySQL 5.5.27-log


I keep receiving this error in my php error Log:

[25-Feb-2014 09:42:56 America/Denver] PHP Fatal error:  
Out of memory (allocated 1310720) (tried to allocate 14 bytes) in /site/domain.com/includes/AutoLoader.php on line 964

here are the settings in my Local Settings file:


if ( !defined( 'MEDIAWIKI' ) ) {
	exit;
}

$wgSitename = "XXXXXX";

$wgScriptPath = "";
##Added for Freindly URLS ## START ##
$wgArticlePath      = "/$1";
$wgUsePathInfo      = true;
##Added for Freindly URLS ## END ##
$wgScriptExtension = ".php";

$wgServer = "http://XXXXXXXX.com";

$wgStylePath = "http://cdn.XXXXX.com/skins";

$wgLogo = "/skins/fg_wiki.png";

$wgGroupPermissions['*']['edit']             = false;
$wgGroupPermissions['*']['createpage'] 	= false;
$wgGroupPermissions['*']['createtalk']  = false;
$wgGroupPermissions['user']['createpage']    = false;
$wgGroupPermissions['user']['createtalk']    = false;
$wgGroupPermissions['autoconfirmed']['createpage'] = true;
$wgGroupPermissions['autoconfirmed']['createtalk'] = true;
$wgGroupPermissions['autoconfirmed']['edit'] = true;
$wgAutoConfirmAge = 86400 * 4; # Four days times 86400 seconds/day

$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO

$wgEmergencyContact = "apache@XXX.com";
$wgPasswordSender = "apache@fXXX.com";

$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;

$wgMainCacheType = CACHE_MEMCACHED;
$wgParserCacheType = CACHE_MEMCACHED; # optional
$wgMessageCacheType = CACHE_MEMCACHED; # optional
$wgMemCachedServers = array( "misc-xf-mcache.ajnafo.cfg.usw2.cache.amazonaws.com:11211" );
 
$wgSessionsInMemcached = true;

$wgUseFileCache = false;

$wgEnableUploads = true;
$wgUseImageMagick = false;


$wgMSU_ShowAutoKat = false;     #autocategorisation
$wgMSU_CheckedAutoKat = false;  #checkbox for autocategorisation checked
$wgMSU_debug = false;           #debug mode
$wgMSU_ImgParams = '400px';     #default max-size for inserted image
$wgMSU_UseDragDrop = true;      #show drag&drop area
require_once "$IP/extensions/MsUpload/msupload.php";

$wgFileExtensions = array( 'bmp', 'doc', 'docx', 'flac', 'gif', 'ico', 'jpeg',
    'jpg', 'mp3', 'mpp', 'odg', 'odp', 'ods', 'odt', 'ogg', 'pdf', 'png', 'ppt',
    'pptx', 'ps', 'rtf', 'svg', 'swf', 'tif', 'tiff', 'xls', 'xlsx', 'xml' );
 
$wgFileBlacklist = array(
    # HTML may contain cookie-stealing JavaScript and web bugs
    'html', 'htm', 'js', 'jsb', 'mhtml', 'mht',
    # PHP scripts may execute arbitrary code on the server
    'php', 'phtml', 'php3', 'php4', 'php5', 'phps',
    # Other types that may be interpreted by some servers
    'shtml', 'jhtml', 'pl', 'py', 'cgi',
    # May contain harmful executables for Windows victims
    'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl' );
 
$wgMimeTypeBlacklist= array(
    # HTML may contain cookie-stealing JavaScript and web bugs
    'text/html', 'text/javascript', 'text/x-javascript',  'application/x-shellscript',
    # PHP scripts may execute arbitrary code on the server
    'application/x-php', 'text/x-php',
    # Other types that may be interpreted by some servers
    'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
    # Windows metafile, client-side vulnerability on some systems
    'application/x-msmetafile'
);

$wgCheckFileExtensions = false;
 
$wgStrictFileExtensions = true;
 
$wgUploadSizeWarning = false;

$wgUseInstantCommons = false;

$wgShellLocale = "en_US.utf8";

$wgLanguageCode = "en";

$wgSecretKey = "2a1ca97dfXXXXXXXXXXXXXXXXXXXXXXXXXXXcf01491a0f138f4d82a06";

$wgUpgradeKey = "efc2XXXXXX2df4";

$wgDefaultSkin = "monobook";
$wgSkipSkins = array("vector", "cologneblue", "modern");

$wgRightsPage = ""; 
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";

$wgDiff3 = "/usr/bin/diff3";

require_once "$IP/extensions/googleAnalytics/googleAnalytics.php";
$wgGoogleAnalyticsAccount = "UA-XXXXXX-7"; 
$wgGoogleAnalyticsIgnoreSysops = false;
$wgGoogleAnalyticsIgnoreBots = false;
$wgGoogleAnalyticsAddASAC = false;

require_once "$IP/extensions/MobileFrontend/MobileFrontend.php";
$wgMFAutodetectMobileView = true;

require_once "$IP/extensions/WikiEditor/WikiEditor.php";

$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
 
$wgDefaultUserOptions['wikieditor-preview'] = 1;
 
$wgDefaultUserOptions['wikieditor-publish'] = 1;

$everyPage=true;
require_once("$IP/extensions/add-to-any-share-save/add-to-any-share-save.php");

require_once "$IP/extensions/SpamBlacklist/SpamBlacklist.php";

$wgSpamBlacklistFiles = array(
   "http://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1",
   "http://en.wikipedia.org/wiki/MediaWiki:Spam-blacklist"
);

require_once( "$IP/extensions/AkismetKlik/AkismetKlik.php" );

$wgGroupPermissions['autoconfirmed']['bypassakismet'] = true;
$wgGroupPermissions['sysop']['bypassakismet'] = true;
$wgGroupPermissions['bot']['bypassakismet'] = true;

require_once "$IP/extensions/Nuke/Nuke.php";

I removed most of the commented code and the Database info. I have tried upping the memory limit several times but nothing seems to help :-/. I have also tried disabling the mobile front end but no luck there either.

Thanks, -Bill

Ciencia Al Poder (talkcontribs)

You have to increase memory_limit in php.ini, to for example 256MB (put a large value first, and then reduce to your needs)

Qops1981 (talkcontribs)

I have maxed it out beyond the 128mb I list above.. The thing I don't get is that it says it has 1.25MB (1310720 bytes) and it just just trying to allocate 14 more.. That doesn't change even If I increase the memory.

Qops1981 (talkcontribs)

Here is an Update. I am still receiving the error.

I have updated my PHP.ini to have a limit if 512MB. I have tried adding ini_set('memory_limit','512M'); to both the LocalSettings.php File & Autoloader.php file. In all scenarios, no matter how high I increase the memory; I receive the same exact error. I have tried commenting out the line in question from AutoLoader.php but the error just shows up as being on the next line. It would appear thats where it runs out of memory.

-Bill

Bawolff (talkcontribs)

Try increasing it in php.ini instead of in a MediaWiki file, just to be safe. (And remove any lines you added to mediawiki's files to increase it)

You can try disabling all extensions just to check that one isn't using an inordinate amount of memory due to some bug.

Qops1981 (talkcontribs)

Hey Bawolff & Ciencia Al Poder,

That is were I have the memory limit increased.. I have it at 512MB up from the original 64MB it was. I incremented it up over time and the error didn't change at any point :-\ The above mention attempts by adding code to the LocalSettings.php file was just onto what I did in the php.ini file.

-Bill

Qops1981 (talkcontribs)

Update: I have changed the account of Child Processes, Min's, & Max's.. I have lowered them all.. My though process is maybe all of the processes are dividing up the memory limit that is set.. It seems to have stopped for 2 of the servers, but not the 3rd.. I have the figured down to 1 on the last one but its still not getting rid of the error.. I will wait until tomorrow to make sure all of the errors have stopped on the other two since all of my logs roll over during the night.

-Bill

Ciencia Al Poder (talkcontribs)

Be sure to restart apache after you change php.ini

Ciencia Al Poder (talkcontribs)

Yes, be sure you're changing it in php.ini (and the right one, see Manual:php.ini), otherwise your host may be limiting the changes you can do to that variable.

Qops1981 (talkcontribs)

Another Update: I was wrong.. Changing the Child Process and what not, did not stop the error.. I check my Logs this morning and they are back :-(.

@Ciencia: these are self hosted Using Amazon EC2 instances where I self install NGINX, PHP, etc, etc. So there is only the one php.ini file.. nothing hidden other than what I put in there.

-Bill

MarkAHershberger (talkcontribs)

When you say "self install", do you mean you're compiling them yourself?

Qops1981 (talkcontribs)

I would yes but I just do "yum -y install" so it all automated.

Qops1981 (talkcontribs)

My reply didn't seem to show up.. So if you see a duplicate.. My Bad..

I just do "yum -y install" so it is all automated.

Ciencia Al Poder (talkcontribs)

what does phpinfo() say for memory_limit?

Qops1981 (talkcontribs)

PHP memory_limit 512M 512M Up from 256MB Up from 128MB Up From 64MB. I incrementally increased to see what would solve it, but 512 seems a but excessive!

Ciencia Al Poder (talkcontribs)

But what does the "allocated" bytes say in the out of memory errors? Are they the same or does they increase when you increase the memory_limit?

Qops1981 (talkcontribs)

No, it stays the same. Which is weird.. PHP info moves up when I change it, so I know PHP is recognizing the change. But the error does not change :-\

Ciencia Al Poder (talkcontribs)

grep the entire MediaWiki installation directory looking for memory_limit. Maybe you have a ini_set('memory_limit','1M'); somewhere.

Look also in .htaccess files and web configuration files, since that setting can also be changed there (and affect only that MediaWiki installation).

Qops1981 (talkcontribs)

Uber Smart Idea:

I found a whole bunch in

./includes/installer/Installer.php:

But I removed them from the list below because I didn't think they would be relevant. Here is the list of files I found it in:

./tests/parser/parserTest.inc:		ini_set( 'memory_limit', $this->memoryLimit * 1048576 );
./tests/phpunit/includes/parser/NewParserTest.php:		ini_set( 'memory_limit', $this->memoryLimit * 1048576 );
Binary file ./extensions/AWS/composer.phar matches
./extensions/LocalisationUpdate/update.php:ini_set( 'memory_limit', -1 );
./HISTORY:* (bug 1000) Clarify warning about memory_limit in installer
./HISTORY:* Fix ulimit parameters for wfShellExec when memory_limit is specified in 'm'
./includes/parser/Preprocessor_DOM.php:		$mem = ini_get( 'memory_limit' );
./includes/normal/UtfNormalMemStress.php:ini_set('memory_limit', BIGSIZE + 120 * 1024 * 1024);
./includes/GlobalFunctions.php:	$memlimit = wfShorthandToInteger( ini_get( 'memory_limit' ) );
./includes/GlobalFunctions.php:			ini_set( 'memory_limit', $conflimit );
./includes/GlobalFunctions.php:			ini_set( 'memory_limit', $conflimit );
./maintenance/runJobs.php:			if ( preg_match( '!^(\d+)(k|m|g|)$!i', ini_get( 'memory_limit' ), $m ) ) {
./maintenance/Maintenance.php:	 * Normally we disable the memory_limit when running admin scripts.
./maintenance/Maintenance.php:			ini_set( 'memory_limit', $limit );
Binary file ./maintenance/composer.phar matches
./maintenance/preprocessorFuzzTest.php:ini_set( 'memory_limit', '50M' );

Do any of them seem likely that they could cause said problem?

Thanks, -Bill

Ciencia Al Poder (talkcontribs)

None of them reduce the memory_limit. The lines in GlobalFunctions.php are for increasing it (only if $wgMemoryLimit is set), but it doesn't reduce it if it's lower than the configured value in php.ini

Maybe the server has no more physical memory for PHP, or there's another limitation imposed by the user running nginx (ulimit for example)

Qops1981 (talkcontribs)

I kind of resolved the issue. I set the Job que to not run except by Cron one a night.. Since I have received no errors and my processor usage has gone down.. I am not sure what that might indicate though.

-Bill

Ciencia Al Poder (talkcontribs)
MarkAHershberger (talkcontribs)

This may be causing some problems. Could you try using the standard package?

Qops1981 (talkcontribs)

Its the standard stable release. Plus I have it running 4 Xenforo Sites, 6 Wordpress sites, and 4 custom PHP sites. My Mediawiki site is the only one displaying an error :-/

Reply to "[Error] [AutoLoader.php] Out of memory!"