13:59 Mon Sep  3, 2007
Cheap Hummer!

12:18 Tue Jul  4, 2006
Hummer Camp After

12:15 Tue Jul  4, 2006
Hummer Camp

Help Me Humpa
PHP and MMS Server Help
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


BUG FIX: memory leak fixed, sending large pics/videos works

 
Post new topic   Reply to topic    Help Me Humpa Forum Index -> MMS Pic Server by Humpa
View previous topic :: View next topic  
Author Message
Humpa
Site Admin


Joined: 06 Nov 2005
Posts: 10258

PostPosted: Thu Aug 16, 2007 9:40 pm    Post subject: BUG FIX: memory leak fixed, sending large pics/videos works Reply with quote

Thanks to vivacia over at www.HowardForums.com, we can now send large files without the script failing because it runs out of memory.

As some of you know, we were adding a line to the send.php to increase the memory_limit in the php.ini on the server.
Code:
 ini_set('memory_limit','32M'); // temporarly increases allowed memory usage to 16M
But not everyone has access to that "fix" though, and it was only a work-around for a problem that should not have existed anyway.

Well, vivacia saw where the problem was, and offered a solution.
Like we always knew, the problem was in the mmsdecoder.php file. The new mmsdecoder.php file is now in the humpa_mms download zip, but I've also made it available here:
www.humpa.com/downloads/mmsdecoder.zip

Just replace/overwrite your existing mmsdecoder.php file with the one in the zip and you are good to go!

For those interested, here's what was wrong.
vivacia wrote:
After looking into it, I found out that mmsdecoder.php uses too much memory in its constructor; it's allocating a big array to store every character in the file as an ASCII character and as a result, too much memory is being allocated.

To fix this, I've changed the code to use convert the characters in the files to ASCII on the fly (or when needed) which has cut down the memory usage a lot. I can now send 400kb pictures with no apparent difficulties.
Back to top
View user's profile Send private message
dacool25



Joined: 29 Apr 2007
Posts: 60

PostPosted: Fri Aug 17, 2007 7:24 am    Post subject: Reply with quote

So all that we need to do is replace the mmsdecoder.php right?


No need for "ini_set('memory_limit','32M'); // temporarly increases allowed memory usage to 16M"
Back to top
View user's profile Send private message
Humpa
Site Admin


Joined: 06 Nov 2005
Posts: 10258

PostPosted: Fri Aug 17, 2007 9:03 am    Post subject: Reply with quote

dacool25 wrote:
So all that we need to do is replace the mmsdecoder.php right?


No need for "ini_set('memory_limit','32M'); // temporarly increases allowed memory usage to 16M"
That's correct.
But every server is different and will have different results with memory usage. I also don't know what everyone's default memory_limit is set to.
Most servers will be set to 8M or 16M I think. I left that ini_set in my file, and I set it to 32M just for good measure - though I see in my phpinfo that my memory_limit is 40M ... lol ... so I guess I should remove that line! Rolling Eyes
Back to top
View user's profile Send private message
Humpa
Site Admin


Joined: 06 Nov 2005
Posts: 10258

PostPosted: Fri Aug 17, 2007 9:12 am    Post subject: Reply with quote

Actually, I think you can just ignore the ini_set memory_limit ... that does not seem to matter.

I just set mine to a memory_limit of 8M (and I verified that my server does allow that and was actually registering the memory_limit as 8M), and I sent a pic that was 470KB (that's about the limit that I can send from my phone - I'm restricted to 500KB by my Verizon VX9900). My pic went thru just fine. HulaGirls
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Help Me Humpa Forum Index -> MMS Pic Server by Humpa All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum