1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Fatal error: Allowed memory size of 33554432 bytes exhausted

Discussion in 'PHP' started by procrastinator, Mar 28, 2007.

  1. #1
    I am getting this error on one of my pages ,

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 14016 bytes) in gallery1.php on line 895

    I am guessing its the php memory limit , can i override it? or is it some other error
     
    procrastinator, Mar 28, 2007 IP
  2. dc dalton

    dc dalton Active Member

    Messages:
    521
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    whatever script you are running is trying to use an asinine amount of memory! The problem is not in your setup it's in some REALLY bad code!
     
    dc dalton, Mar 28, 2007 IP
  3. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Definitely something in your code. You shouldn't need that much memory.

    If you want us to take a look at the code then just post it.
     
    streety, Mar 29, 2007 IP
  4. veridicus

    veridicus Peon

    Messages:
    52
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I've only run into this problem when I've written an infinite loop. Check to see if line 895 is within an infinite loop.
     
    veridicus, Mar 29, 2007 IP
  5. procrastinator

    procrastinator Peon

    Messages:
    1,718
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The text that you have entered is too long (34591 characters)

    ..so i am attaching the file
     

    Attached Files:

    procrastinator, Mar 30, 2007 IP
  6. cakker

    cakker Well-Known Member

    Messages:
    165
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    140
    Digital Goods:
    1
    #6
    just add this to the top of the page:

    ini_set("memory_limit","80M");

    or you can change the 80 as you wish/needed.
    krisztian
     
    cakker, Mar 30, 2007 IP
  7. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The good old faithful . . . when all else fails . . . use brute force.
     
    streety, Mar 31, 2007 IP
  8. Curtis:Johns

    Curtis:Johns Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hey this is my index.php code and it says this when i try to go on my site

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 4864 bytes) in /home/habbon/public_html/Home/index.php on line 15
    Whats the error?

    Cheers CJ

    <?php
    /**
    * @version $Id: index.php 10381 2008-06-01 03:35:53Z pasamio $
    * @package Joomla
    * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
    * @license GNU/GPL, see LICENSE.php
    * Joomla! is free software. This version may have been modified pursuant
    * to the GNU General Public License, and as distributed it includes or
    * is derivative of works licensed under the GNU General Public License or
    * other free or open source software licenses.
    * See COPYRIGHT.php for copyright notices and details.
    */

    $_REQUEST['tmpl'] = 'component';
    include('index.php');
     
    Curtis:Johns, Dec 6, 2008 IP
  9. lordofthelake

    lordofthelake Peon

    Messages:
    70
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    The problem is that probably you have too many Joomla extensions loaded or that some of them are consuming too much memory... it happens sometimes with extensible CMS's.
     
    lordofthelake, Dec 7, 2008 IP
  10. diabloroxx

    diabloroxx Well-Known Member

    Messages:
    432
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #10
    Well am having the same problem in one of my servers. While the same script works well on other servers, it fails to do so on the current server. I guess it has something to do with the server's php configuration as well.
     
    diabloroxx, Apr 4, 2009 IP
  11. FrankBauer

    FrankBauer Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Hello
    I have the same issue with WordPress when triyng to update a plugin (downloads.wordpress.org/plugin/gd-star-rating.zip)

    Any idea to solve ?
    Thanks
     
    FrankBauer, Nov 19, 2009 IP
  12. SCOTTIESIL

    SCOTTIESIL Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I just installed a link submitter scipt for my free clickconversion.net blogs and it broke my reseller account. where do I check. Log files? .ini file, using cpanel.
     
    SCOTTIESIL, Nov 20, 2009 IP
  13. mhgold

    mhgold Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    my this problem was solved as soon as I found php.ini in root folder and searching for memory_limit and replaced 32MB with 64MB.
     
    mhgold, Jun 11, 2010 IP
  14. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #14
    You need to edit php.ini
    memory_limit must be changed!
     
    roopajyothi, Jun 11, 2010 IP
  15. VisibleGhost

    VisibleGhost Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Hello,

    I'm a long time amateur coder and have once again gone searching for an answer to this problem.

    History:

    Was running php scripts that needed more memory and found the original solution to work by upping the memory to 64M and everything ran great after that ( for the last 2yrs ).

    Now today I decided to upgrade my MySql databases to 5.1, after doing so my site now will not run the same scripts that ran before with less memory. I have two scripted php pages that I run that I used for testing my problem, one is an admin page and the other is the site itself. After upping the memory limit to 128M the smaller admin page worked just fine but the larger one for the main site does not work still.

    For testing purposes I upped the memory limit to 1028M ( large I know and should not be needed ) the main script PARTIALLY works with the larger memory limit. Had to up the memory limit to 2056M to get full functionality out of php script.

    Considering I only upgraded the MySql database why would my site handle php files and their sizes differently. Why would I need this much memory now when I didn't prior to the MySql upgrad. Is there anyway to get it to act the way it did before? Or am I going about this the wrong way because this is just boggling my mind?

    Any help is greatly appreciated in advance.

    VG
     
    Last edited: Jul 4, 2010
    VisibleGhost, Jul 4, 2010 IP
  16. VisibleGhost

    VisibleGhost Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    After much trial and error and communication with my server provider, we have solved my memory problem. The result was a rebuild of my Apache and PHP services which were giving compile errors thus the need for my providers help. Once finished everything is back to normal.

    Just thought I'd let someone know how my issue was resolved because I know many don't follow up once their problems are solved in order to share the information.
     
    VisibleGhost, Jul 5, 2010 IP
  17. vocongdanh

    vocongdanh Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #17
    Edit file php.ini set memory_limit = 80M
     
    vocongdanh, Jul 6, 2010 IP
  18. hackshields

    hackshields Greenhorn

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #18
    That's too much in taking memory
     
    hackshields, Jul 6, 2010 IP
  19. mriso

    mriso Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    clean your variable before entering the next loop. This usually happens when you´re using nested loops.

    Before the second loop, add

    $var = ''

    ($var is the name of your variable)
     
    mriso, Aug 6, 2010 IP
  20. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #20
    or use
    unset();
    PHP:
    I think its equiv to free(); in C.
     
    Kaizoku, Aug 6, 2010 IP