Since I know there are professional developers out there, a question. Starting Sunday morning, whenever I attempt to Edit the BJ Lexicon, I’ve been getting the same message:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/jcole010/domains/golive.balloon-juice.com/public_html/wp-includes/general-template.php on line 1524
I’ve tried it on two separate systems, so I don’t think it’s my PC. Can anyone out there tell me if there’s something I can do from the peon user end to rectify this? Or at least explain why WordPress has banhammered me in terms I can understand?
General Winfield Stuck
The webmistress is still fiddling with the dials, i suspect. Little things have changed for me. Like I used to be able to just click on a commenters right side date/time stamp to copy it to my comment box, but now have to hit the little curved arrow. If you’re using Vista, then good luck, all sorts of little snafus come and go for me anyway.
shoutingattherain
Try typing in the words “Fuck you, WordPress”. It won’t fix the problem, but it will make you feel better.
JK
Anne,
Have you posted a question to this site?
http://codex.wordpress.org/FAQ_Forums
Maybe, someone on one of the forums could give you some advice.
brent
Do you run wordpress updates yourself or does it update automatically? It would seem to be a server side error caused by some specific loop in the application but if the app hasn’t been updated recently then it might just be a server resources issue.
JK
Have you looked on this page for a possible answer?
http://faq.wordpress.net/view.php
Mister Papercut
I think it’s a job for the webmistress.
Doctor Science
Here is a likely solution:
May have to increase the amount of memory a PHP script may consume
1. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 8M try 16M:
memory_limit = 16M ; Maximum amount of memory a script may consume (16MB)
2. If you don’t have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 16M
3. Talk to your host.
You might also try disabling Plugins if you can’t increase PHP memory. I understand some plugin such as Google Sitemap use quite a bit of memory.
cleek
Allowed memory size of 33554432 bytes exhausted
i’d assume your ISP has limited your account to a memory limit of 32MB, and for some reason, WP is hitting than when it tries to allocate a 120K file (which means it’s pretty much right on the edge of failure).
mai naem
Have no idea what you are asking about but I want to say y’all missed Calvinball and Brooks Brothers Riot in the Lexicon.
Steeplejack
I concur with Doctor Science. I haven’t doinked with WordPress in a while, and that was a one-time deal, but I would try what the good doctor suggests.
Steeplejack
Shorter version: It’s not you, it’s WordPress.
sujal
Dr. Science’s comment is right on. PHP limits the amount of memory it will use on the server. Your server looks to be set for 32M already, so you may need to have whoever maintains the server set it to 48M or 64M.
Poicephalus
Ahh,
a first step towards wisdom, recognition of one’s place.
PeonUserClient
Best of luck with all the help you will receive from our motley crew. You’d be better off pasting the error message into your search-engine of choice.
Peace,
C
The Other Steve
This is WordPress saying “It’s not you, it’s me.”
Martin
32MB is a pretty high PHP limit. See if the webmistress can look into places to optimize a bit. WP has a pretty bad reputation – is it known for being memory inefficient?
AW
Ask your Server Overloads to kill any zombie php / fcgi processes. Or just reboot the server, if that’s an option (it is on some virtual private servers).
Hob
That’s a really humungous amount of memory for WP to be using, which makes me think there’s a bug causing a script to chew up more and more memory till it inevitably dies. In that case, increasing the memory limit won’t help. I don’t know why it would’ve suddenly started breaking, if nothing was recently installed or upgraded. Basically I’m no goddamn help at all.
bago
Cleek is right about the system being close to failure when loading a 120k file gives you an allocation error. I’m guessing only the cms admins can make a page request that large though.
sidereal
Don’t ask to reboot the server. The PHP memory cap is a per-process limit. You can try jacking it up to 48, per sujal’s suggestion, but 32 is already a pretty big cap, and if a bunch of requests are going simultaneously and using a big chunk of memory, you’re likely to start running out of memory and/or swapping and/or crashing your server.
I would investigate why your requests want to use such an absurd amount of memory. If your webmistress is very clever, this will involve dropping occasional error_log(memory_get_usage()) calls throughout the script to see where the memory usage is spiking up.
Bad Horse's Filly
Shorter Word Press: me no like you. me ban you. nothing you can do about it. bwahahaahaha.
HankP
cleek, Martin and sidereal have it right, you have 32M allocated to PHP and you’ve exhausted your memory pool. You can ask the webmaster/mistress to increase the PHP memory allocation. You can also ask them to install APC, it caches PHP requests, lowers the memory requirements for PHP and speeds up the site as well. WordPress (like Drupal at our site) can use a lot of PHP memory.
Earl Hathaway
If you’ve edited that document very heavily, it might be that wordpress is freaking out about 100s (or 1000s) of edits to the doc. In otherwords, it might be specific to the lexicon page.
I’m not a php dev, but I am a dev…
Earl
JGabriel
Anne,
Short version: Doctor Science and Cleek have the right take on it. It’s a memory allocation error; i.e., the application is looking for memory to work with and can’t find enough. Whether it’s looking for RAM, as Doc Science suggests, or Hard Drive space, as Cleek suggests, I don’t know.
Shorter version: It’s a job for your webmistress.
.
bago
Cleek didn’t suggest hard drive space. He was just saying that if loading a 120k file pops your memory limit, you’re already on the edge of a cliff.
JGabriel
@bago:
You could be right. Cleek suggested that the problem was due to a limit set by the ISP, which I read as hard drive space rather than RAM. If not, my bad. Apologies for the confusion or incorrect assumption if I’m wrong.
.
bago
@JGabriel: The error clearly states that on line 1524 on the general_template.php script there is a memory allocation of 120k that pushes it past the defined limit of 32 mb (ish. . It’s 2^25th bytes allowed to be allocated, a weird number)
MelodyMaker
No. Upping the php limits is one wrong way to go. Remove them. ask the hosting co’s FAQ. do it at a high level, and it trickles down. if you’re lucky. take notes. Can’t fix it in WordPress. Or I’m wrong. thanks.
mistermix
Doctor Science has the right answer, but the number you want to use is 48M (and if that doesn’t work, 64M), as sujal points out. Hard drive space has nothing to do with it.
After that’s done, your WordPress install will use more memory on the server. If your server doesn’t have enough RAM to handle the new, bigger B-J, your webmistress will need to adjust for that (buy a bigger slice, add more RAM to your server, whatever).
Egypt Steve
hey, you should put “bleg” in your lexicon — I assume a hybrid of “blog” and “beg???? Or was it just a misspelling.
polyorchnid octopunch
Dr. Science etc have the right answer. For the purposes of memory allocation on the server, RAM and HD space are basically the same thing… memory for the process comes from RAM, backed up by swap space on the hard drive.
I’m with the people who suggest that perhaps there’s a script that’s eating up a lot of memory; it’s pretty easy to create memory leaks in long running processes if you’re not careful. As WP (which I have no experience with, in all truth) is a server process, there are long running scripts there in all likelihood.
I’m going to agree that just upping the memory limit without knowing what’s chewing up the memory is a mistake… it only puts off the problem instead of solving it. It might be that there’s just too many toys on and there’s no memory leak, and it’s only because (as mentioned above) you have a large doc with a lot of edits being saved; one possible solution might be to turn down the undo level (though again, I’ve no experience with WP, so I don’t know if that’s possible, or even a feature). This is a case where you need someone that understands WP internals to take a look at your config and the libraries you’re loading (someone mentioned Googly stuff up above, for example) and do some app profiling and observation of it as it runs and see what they can figure out… if it turns out that your chosen set of libs plus the basic WP stuff runs up to 28MB but doesn’t grow, in fact turning up the memory limit on PHP to 48 MB might be the right solution.
nick
As I’m assuming that not many people working on the Balloon Juice system are programmers, I doubt there’s anybody who can go into the depths of WordPress’s PHP code to see what is filling up memory (objects, copies of arrays being passed around, etc.). Disabling a few plugins may help; there might be a few being run on the site that are taking up the 32 MB limit.
But frankly, I’ve found that it’s easier to simply up the memory_limit setting in the php.ini file when analyzing similar issues. Frankly, when it comes down to it, WordPress is an open-source package that’s designed to be fairly simple to extend with plugins. That comes with a design that’s easier for a programmer to read than efficiency of memory usage. And adding memory is often cheaper than developer time these days.
Understand that this is simply a memory limit setting for PHP programs; scripts that are using less than 32 MB per run will still use the same amount of RAM as before. It’s those scripts that go past those limits that we are worried about. In this case, editing the lexicon dictionary seems to surpass the limit, so it’s best to increase in small intervals until whatever you’re trying to do works.
In other words, this is something the server administrator (or webmaster/webmistress) needs to take care of. There’s not much an end user can do at this point until you can actually edit the lexicon page.
Chuck
I’ve looked into WordPress’s code before. It’s some of the worst I’ve ever seen, and I’ve worked on MediaWiki which is full of ugly hacks. It not only uses no template layer and thus escapes nothing by default, leaving it wide open to XSS and CSRF attacks, there is virtually no .php file in there that doesn’t spit out some html as a side effect. Just changing themes can break code or open security holes. God only knows what it’s using for the db layer, but I have to imagine it’s full of SQL injection holes.
You might be stuck with WP for the features it has and the fact that all your data’s in it, but never be under the illusion that it has any semblance of quality whatsoever.
twiffer
upping a memory allocation limit is a short term fix. if you’ve got a memory leak, you’ll wind up with the same problem again. eventually.
i’m by no means an expert on the tech side (too much of a generalist, alas), but my job is managing troubleshooting, restoration of service and root cause analysis. if you’re going to go with the temp fix, make sure you use the time it buys to find and fix the actual problem.
fishbane
Chuck –
That’s a bit harsh – WP isn’t *that* bad. You may prefer to use layer upon layer and play API poker, but that is generally incompatible with a design goal of running on cheap VPSes.
If you know of XSS/injection/whatever attacks, by all means point them out. I kinda doubt you know of any, at least in recent versions, though; the code is public, highly used, and not all that complex. The incidence of actual exploits is higher than I like to see, but hardly the worst in the field.
Back on topic, yes, science got it right.
terry chay
Actually upping the memory allocation probably won’t fix the problem. The PHP script used 33MB of memory to process it which should be enough unless it’s caught in some loop. Processing your post takes more resources than serving pages (especially since you turned on a caching plugin), but not THAT much more.
BTW, PHP releases memory back to Apache after it finishes processing a request so memory leaks don’t hurt it permanently or affect other requests.
I don’t think this is WordPress’s problem, it is more likely a poorly written plug-in or the install was hacked. (Disclaimer: I’m biased since I work for the company that developed it). The first thing you guys should do is upgrade your install from 2.7.1 to 2.8.4. Continuing to run 2.7.1 in a self-hosted install is just asking for trouble. ;-)
vdibart
What specific text are you trying to add to the page? For instance, if you keep trying to paste the same thing in and you get that message it’s possible that whatever you are trying to add is somehow involved. Is it always the same text that causes it or is it *any* text?
p m
this has happened to me using both WP 2.7 and 2.8.
here are a few ways to fix the problem (at least temporarily).
#1 on that list worked for me.
good luck!