Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jul 2006
Posts: 116
M
member
member
M Offline
Joined: Jul 2006
Posts: 116
Recently moved to a new host, running ubb.threads 7.5.6 along with MySQL/PHP 5. In my apache error_log I'm noticing a lot of the following messages:

[Mon Jun 04 23:48:12 2012] [error] [client X.X.X.X] PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 523800 bytes) in /my/path/to/ubbthreads/libs/html.inc.php on line 119

According to php.ini, my memory_limit is at 64MB.

What could be causing these errors, and, how do I resolve them?

Thanks.

Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
What's happening? PHP is getting overloaded. How do you fix it? Tell your host you need the PHP memory size upped. Info about the error


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jul 2006
Posts: 116
M
member
member
M Offline
Joined: Jul 2006
Posts: 116
Thanks Gizmo, that was helpful.

I'm on a VPS, so I could increase the PHP memory_limit from 64MB to 128MB and see how it goes.

Given that I'm running 7.5.6 aren't there some commonly accepted values that seem to work for most people? I guess I'm just wondering what are the contributing factors to the memory usage? How big or busy the forums are?

Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
I'm not sure what all leads to the memory limit, I'd assume traffic accessing the webserver and php script utilization over time you'll have increased values; as no webserver/site/traffic is exact it'd really be impossible to have an end all be all for configurations, tuning your webserver according to your needs is why there are so many configuration variables.

The "core information" for memory limit is pretty lacking, but you can see the section on their manual here, the page suggests though (just above where that link takes you) that the default they specify is something like 128mb.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jul 2006
Posts: 116
M
member
member
M Offline
Joined: Jul 2006
Posts: 116
So I upped the limit to 128 MB, but still get the Fatal error.

The most recent was here:

[Wed Jun 06 06:21:07 2012] [error] [client X.X.X.X] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 15851277 bytes) in /my/path/to/ubbthreads/libs/ubbthreads.inc.php on line 835

Line 835 happens to be the return from function graemlin_url:

PHP Code
return preg_replace( $patterns, $replaces , $output ); 

Any other ideas?

Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
It's still trying to allocate 15mb above your limit.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jul 2006
Posts: 116
M
member
member
M Offline
Joined: Jul 2006
Posts: 116
Yes, I noticed smile

Still don't know why though. Should I keep increasing until the errors go away? Can I safely ignore?

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
how many smileys do you have?

that preg_replace needs a lotta memory and i'm guessing you have a ton of smileys?

Joined: Jul 2006
Posts: 116
M
member
member
M Offline
Joined: Jul 2006
Posts: 116
I have 34 smileys (graemlins) in total. Is that considered a lot?

Last edited by Myke; 06/11/2012 9:07 PM.
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
no.. 34 isn't that many at all... i've seen over 100 many times..

hrm..... something else is going on and without real access, it's a guessing game..

Joined: Jul 2006
Posts: 116
M
member
member
M Offline
Joined: Jul 2006
Posts: 116
Well, since I do have access smile are there any suggestions as to how I may debug this?

Joined: Sep 2006
Posts: 3
B
stranger
stranger
B Offline
Joined: Sep 2006
Posts: 3
Meh crazy

Joined: Dec 2003
Posts: 16
C
stranger
stranger
C Offline
Joined: Dec 2003
Posts: 16
So I'm having this same problem with memory allocation and resource s are being eaten. It looks like its eating a gig!

lep is entry process limit, essentially the number of scripts and such that can be run
Amem = average mem
Mmem = max memory usage
lmem = mem limit
memf = number of times the scripts have trashed because it reached the memory limit.


From To aCPU mCpu aEP mEP lEP aMEM mMEM lMEM MemF MepF
12-06 12:00 12-06 12:05 0 16 0 0 20 0 0 1.0G 0 0
12-06 11:00 12-06 12:00 0 33 0 0 20 492K 89.1M 1.0G 0 0
12-06 10:00 12-06 11:00 0 33 0 0 20 972K 290.0M 1.0G 0 0
12-06 09:00 12-06 10:00 0 33 0 0 20 0 0 1.0G 0 0
12-06 08:00 12-06 09:00 0 50 0 0 20 6.6M 1.0G 1.0G 233 0
12-06 07:00 12-06 08:00 0 66 0 0 20 13.5M 1.0G 1.0G 1090 0
12-06 06:00 12-06 07:00 0 50 0 0 20 6.3M 1.0G 1.0G 231 0
12-06 05:00 12-06 06:00 0 33 0 0 20 124K 87.7M 1.0G 0 0

So the question is this: What can I do to reduce the amount of memory this is eating (because the ISP has already said they will not increase my memory. They are using CloudLinux and it limits the cpu and memory usage per user). I'm somewhat stuck here. Do I need to seek a different ISP?



If at First you do not succeed then Skydiving is not for you..
Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
Have they told you WHAT is eating all of the resources? There isn't much you can do if you can't see what scripts are effecting apache/mysql, if apache/mysql are indeed what's going crazy, etc.

If you have a large site I'd recommend running a VPS (I use Interserver for mine [3 slice CentOS VPS with no included cpanel in the NJ center]).


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Dec 2003
Posts: 16
C
stranger
stranger
C Offline
Joined: Dec 2003
Posts: 16
So after further checking its not UBBS, its wordpress that is screwing up. UBBs is running happy as a clam...until wordpress sucks up all the resources... Time to go hit a different blog...

Thanks




Last edited by Charlie Heidal; 12/06/2012 11:35 PM.

If at First you do not succeed then Skydiving is not for you..
Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
Lol, not a problem; the UBB is a pretty light script, so unless you had tons of traffic it should be able to utilize it with little issue...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Dec 2003
Posts: 16
C
stranger
stranger
C Offline
Joined: Dec 2003
Posts: 16
Problem solved, moved to a new ISP with better protection for my site (spam bots were attacking the old site). Anyway, so I'm on the new system and finally (!) have access to a php5.ini file. I have memory_limit=128M to alleviate some other issues I was seeing. I have one hurdle I cannot seem to get past. I have the following variables set:
upload_max_filesize = 5M
post_max_size = 5M
yet I get this when I upload a 682K image through image manager for one of the boards.

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 6695129 bytes) in /home/content/52/10210752/html/ubbthreads/libs/ubbthreads.inc.php on line 898

It looks like its absorbing almost 7 meg to handle a < 1 meg image...or am I missing something? (*only one other user on the boards at the time and he's reading posts only).



Last edited by Charlie Heidal; 12/30/2012 8:58 PM.

If at First you do not succeed then Skydiving is not for you..
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
well the allowed size 134217728 bytes equals 128mb which I believe is called memory_limit in php.
So your message tells me that your environment has 128mb set and did not have enough system memory free to allow up to 6695129 possible bytes that ubb is trying to reserve to use for uploading.
So that equates to 6mb which is probably the limit you set in ubb.

I am not sure how to check how much of the memory_limit is being used or what is using it.

But you could try to lower the ubb setting for now to 1mb which would be 1048576 to enter in ubb if you can't increase the memory_limit, At my site memory_limit is set to 256M


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
It's just the memory limit, and I'm not aware of anything to check what is in use...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Dec 2003
Posts: 6,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
Well I did find something to read it
create a php file with:
PHP Code

<?php
echo system('free');
?>

upload it to your server.
Then run it in your browser
But I can't figure out how to read what it really means.

what I got back was:
Quote
total used free shared buffers cached Mem: 6083128 5719164 363964 0 195752 3437780 -/+ buffers/cache: 2085632 3997496 Swap: 14319608 136 14319472 Swap: 14319608 136 14319472


Blue Man Group
There is no such thing as stupid questions. Just stupid answers

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
3 members (rootman, Gizmo, Nightcrawler), 562 guests, and 186 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)