www.webdeveloper.com
Results 1 to 11 of 11

Thread: Fatal error: Allowed memory size

  1. #1
    Join Date
    Feb 2008
    Location
    Edmonton, AB
    Posts
    34

    Fatal error: Allowed memory size

    Hey All,

    I'm having an issue with a few cms/blog applications. I currently have shared hosting and my allowed memory is 32MB. I have spoken with my host and they say they cannot raise it. My big issue comes when I try and use photo gallery apps. I always get the "Fatal error: Allowed memory size...blah blah blah". Currently I am attempting to use Silverstripe(which aside from being slow at times, runs great, unless i try and upload images), and Plogger(which i cannot upload any image regardless of size, even 100K).

    My actual error is as follows:
    Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/grasree6/public_html/testing/ploggerb3/lib/exifer1_5/makers/olympus.php on line 155

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 268632065 bytes) in /home/grasree6/public_html/testing/ploggerb3/lib/exifer1_5/makers/olympus.php on line 155

    I've looked into everything and I'm quite certain it is just my hosts allowed memory.

    I guess my real question is can anyone suggest a good lite weight cms/photogallery tool that can work well on a 32MB shared hosting server?

    Cheers and thanks again!

    G

  2. #2
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    huh, you're going over the ram limit by quite a bit, what code are you doing, either you need to rethink your logic, or you want to watch for infinite loops, which can be a real pain.
    If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
    The same applies to HTML and the forums [HTML][/HTML] tags.

  3. #3
    Join Date
    Feb 2008
    Location
    Edmonton, AB
    Posts
    34
    I get that error when I try and upload a 1MB image through the Plogger interface. That large memory error is strange, and all my research points that it is not a plogger issue but a hosting issue. I'm defiantly not a coding expert. I'm more looking for a light weight cms/photogallery tool.

    Thanks for the response!

  4. #4
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    http://google.com/search?hl=en&safe=...MB&btnG=Search

    256 MB of ram doesn't sound like it's just a heavy environment, there is no logical reason for such a huge ram requirement, unless you are doing something daft with gd or whatever.
    If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
    The same applies to HTML and the forums [HTML][/HTML] tags.

  5. #5
    Join Date
    Feb 2008
    Location
    Edmonton, AB
    Posts
    34
    I couldn't agree more lol. It very well may be a plogger issue i guess, but nothing i found in their documentation of message forums lead to a reason. Any suggestion of a better app?

  6. #6
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    just wondering, but can you show the lines 150-160 or so of: /home/grasree6/public_html/testing/ploggerb3/lib/exifer1_5/makers/olympus.php

    That's where your error messages are coming from, there might be something simple there that just needs a tiny edit.
    If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
    The same applies to HTML and the forums [HTML][/HTML] tags.

  7. #7
    Join Date
    Feb 2008
    Location
    Edmonton, AB
    Posts
    34
    Thanks for the help. This plogger thing is a pretty complex app from what i can tell. here the bit o code that pertains to the line 150 error. I included the whole function.

    PHP Code:
    //=================
    // Olympus Special data section
    //====================================================================
    function parseOlympus($block,&$result,$seek$globalOffset) {    
            
        if(
    $result['Endien']=="Intel"$intel=1;
        else 
    $intel=0;
        
        
    $model $result['IFD0']['Model'];

        
    $place=8//current place
        
    $offset=8;
        
            
    //Get number of tags (2 bytes)
        
    $num bin2hex(substr($block,$place,2));$place+=2;
        if(
    $intel==1$num intel2Moto($num);
        
    $result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
        
        
    //loop thru all tags  Each field is 12 bytes
        
    for($i=0;$i<hexdec($num);$i++) {
            
                
    //2 byte tag
            
    $tag bin2hex(substr($block,$place,2));$place+=2;
            if(
    $intel==1$tag intel2Moto($tag);
            
    $tag_name lookup_Olympus_tag($tag);
            
                
    //2 byte type
            
    $type bin2hex(substr($block,$place,2));$place+=2;
            if(
    $intel==1$type intel2Moto($type);
            
    lookup_type($type,$size);
            
                
    //4 byte count of number of data units
            
    $count bin2hex(substr($block,$place,4));$place+=4;
            if(
    $intel==1$count intel2Moto($count);
            
    $bytesofdata $size*hexdec($count);
            
                
    //4 byte value of data or pointer to data
            
    $value substr($block,$place,4);$place+=4;

            
            if(
    $bytesofdata<=4) {
                
    $data $value;
            } else {
                
    $value bin2hex($value);
                if(
    $intel==1$value intel2Moto($value);
                
    $v fseek($seek,$globalOffset+hexdec($value));  //offsets are from TIFF header which is 12 bytes from the start of the file
                
    if($v==0) {
                    
    $data fread($seek$bytesofdata);
                } else if(
    $v==-1) {
                    
    $result['Errors'] = $result['Errors']++;
                }
            }
            
    $formated_data formatOlympusData($type,$tag,$intel,$data);
            
            if(
    $result['VerboseOutput']==1) {
                
    $result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
                if(
    $type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
                    
    $data bin2hex($data);
                    if(
    $intel==1$data intel2Moto($data);
                }
                
    $result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
                
    $result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
                
    $result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
            } else {
                
    $result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
            }
        }

    Cheers!
    G

  8. #8
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    Ah, looks like a corrupt text file, it's reading in an invalid size, that's why it throws the error at being unable to read in an invalid length of the file, causing it to run out of ram because it's caught in an infinte loop of loading a huge load of nothing from the text file.

    I could be wrong, but it looks right, I've no idea how you would fix that however, I'm assuming deleting the text file won't just work...
    If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
    The same applies to HTML and the forums [HTML][/HTML] tags.

  9. #9
    Join Date
    Feb 2008
    Location
    Edmonton, AB
    Posts
    34

    Thumbs up

    Thanks again for your input!

    Although I'm not a "coder" i do understand how all this works for the most part. Can you point out where this text file is referenced? Maybe I can go to the Plogger forums with some informed questions and find a solution?

    Cheers!

  10. #10
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    The file name isn't mentioned in that function, by the looks of it the output of the file is fed into the function as the first argument.

    I have no idea where the text file is mentioned or comes from, you will most likely have to ask on their forums or via an email to a member of their dev team about that, sorry I can't be any more help.
    If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
    The same applies to HTML and the forums [HTML][/HTML] tags.

  11. #11
    Join Date
    Feb 2008
    Location
    Edmonton, AB
    Posts
    34
    Do not apologize my friend. Thanks so much for the help in the right direction! Cheers!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles