Page 1 of 1
Re: Memory alloaction issue
Posted: Tue Jun 17, 2014 2:21 am
by arivu
Hi,
I am using the function explode or preg_split. I am getting error as "Allowed memory size of 268435456 bytes exhausted (tried to allocate 131223 bytes)" in the following line.
$explode_text = explode("|", $text);
$explode_text = preg_split("/\|+/", $content);
How to solve this issue. with out increasing the size of the memory?
Kindly help me.
thanks,
arivu
Re: Re: Memory alloaction issue
Posted: Tue Jun 17, 2014 2:24 am
by requinix
Don't hijack threads.
$text/content is too large to hold another copy of it in memory. Find another solution to your problem that doesn't involve explode() or preg_split().
If you need help with that, an explanation of what you're dealing with would be appreciated.
Re: Memory alloaction issue
Posted: Tue Jun 17, 2014 7:29 am
by arivu
Hi,
I am getting error while adding the bulk content.
"Allowed memory size of 268435456 bytes exhausted (tried to allocate 131223 bytes)" in the following line.
$explode_text = explode("|", $content);
$explode_text = preg_split("/\|+/", $content);
Increase the memory is the solution for this issue.
But this plugin needs to work in Shared hosting environments, i can't increase a VPS to that much memory.
So kindly give solution for this issue,
Thanks,
arivu
Re: Memory alloaction issue
Posted: Tue Jun 17, 2014 8:06 am
by Celauran
Increase the memory is the solution for this issue.
No, throwing hardware at a problem is not really a solution. You haven't shown us what you're trying to do or why you're trying to do it that way, so we can't help you. We've got nothing to work with.
Re: Memory alloaction issue
Posted: Tue Jun 17, 2014 11:14 pm
by arivu
Hi,
I have created custom plugin for posting the content in wordpress. Based on content keywords I have allocated the pages for that custom post.
If i added the small content. i did not get any error. while adding the bulk content i am getting memory allocation issue.
The added content contains special characters, html code and text, so i will explode the content using the below code.
$explode_text = explode("|", $content);
$explode_text = preg_split("/\|+/", $content);
I am getting memory allocation error as below.
"Allowed memory size of 268435456 bytes exhausted (tried to allocate 131223 bytes)" in the following line.
any other function(without kill the memory) like the explode.
any solution for this issue?
thanks,
arivu
Re: Re: Memory alloaction issue
Posted: Tue Jun 17, 2014 11:40 pm
by requinix
Are you reading our replies? I'm not going to spend any more time trying to help you if you aren't reading our replies.
Re: Re: Memory alloaction issue
Posted: Tue Jun 17, 2014 11:56 pm
by arivu
I am reading all reply. Kindly help me