PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

PHP memory errors, not that big a site

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP memory errors, not that big a site

    Hello,

    I have searched the forums and tried the fixes suggested in the FAQ:
    Q. "Fatal error: Allowed memory size of 8388608 bytes exhausted..." or similar error message
    But I still get memory error messages when I try the zoom search.php script. The error seems to occur at different points in the script as I adjust the memory allocation on the search.php script itself. As for php.ini I have it set to 64MB. But the errors still occur even when I set:

    ini_set ( "memory_limit", "512M");
    in the search.php script. Thing is, my search index only has 9200 pages/files. Any idea what I am doing wrong? I am using PHP 5.2.14, Many thanks,

  • #2
    What is the exact error message you are seeing?

    It might be possible that you are on (cheap) shared hosting and they have disabled your ability to use ini_set to request a higher RAM limit.

    For others reading this the FAQ location is here,
    http://www.wrensoft.com/zoom/support...hp_outofmemory

    Comment


    • #3
      For others reading this the FAQ location is here,
      http://www.wrensoft.com/zoom/support...hp_outofmemory
      yes, thank you.

      I've pasted the errors below, preceded by the ini_set I used:

      ini_set ( "memory_limit", "512M");
      Fatal error: Out of memory (allocated 38273024) (tried to allocate 257 bytes) in /usr/.../zoomsearch/search.php on line 1569

      ini_set ( "memory_limit", "256M");
      Fatal error: Out of memory (allocated 38273024) (tried to allocate 257 bytes) in /usr/.../zoomsearch/search.php on line 1569

      ini_set ( "memory_limit", "128M");
      Fatal error: Out of memory (allocated 3853516 (tried to allocate 257 bytes) in /usr/.../zoomsearch/search.php on line 1569

      ini_set ( "memory_limit", "64M");
      Fatal error: Out of memory (allocated 38273024) (tried to allocate 35 bytes) in /usr/.../zoomsearch/search.php on line 1572

      nothing
      Fatal error: Out of memory (allocated 3853516 (tried to allocate 257 bytes) in /usr/.../zoomsearch/search.php on line 1568

      It might be possible that you are on (cheap) shared hosting and they have disabled your ability to use ini_set to request a higher RAM limit.
      At any rate I would think 64M would be enough.

      This is not a deal breaker, I just wanted to see how the php version worked and was hoping I could use the search.php script to make some modifications to the search results, (ie some event handlers to deselect check boxes when others are clicked, kinds of things I can't access in the search_template.html file). I have been using the zoom cgi with a lot of success and managed some javascript workarounds without accessing the script. Thank you for your kind attention. fwiw it was good that I boosted the RAM in php.ini, now my other pages are running faster. Thank you,

      Comment


      • #4
        At any rate I would think 64M would be enough
        Maybe it would be. But you don't have 64MB to play with.

        Note that the error you get is always the same in terms of how much RAM could be allocated before failure (~38MB of RAM). So this shows the setting changes you are making, to try an increase the RAM limit, are being ignored. You never get more than 38MB.

        Modern web servers typically have 4GB of RAM or more. So only being allowed to use 1% of the available RAM in the machine sucks.

        You should ask your hosting company if they can increase the limit.

        Comment


        • #5
          Modern web servers typically have 4GB of RAM or more. So only being allowed to use 1% of the available RAM in the machine sucks.
          Yah it does!

          You should ask your hosting company if they can increase the limit.
          I will, thank you for looking at the errors and for your insight, I appreciate the guidance.

          Comment


          • #6
            fwiw, this is the response I got -
            While it's true that you can adjust the memory amount on the php.ini account
            that does not actually increase the amount of ram your account has access to. As
            this is a shared web hosting account and you share web server resources with
            many other customers your account is limited to how much ram it can consume. You
            will not be able to actually use 64M of the servers RAM just for your scripts.
            At $50 a month I do not consider that 'cheap'. JFYI.

            Comment


            • #7
              At least you got a response to confirm the fact that they have limited your use. The really cheap hosts often deny there is a problem, or don't answer at all.

              Of course if it is their policy to severely limit your use of the machine's resources, then they need to advertise all the restrictions they have put in place before you sign up.

              If they aren't letting you use 64MB for even a few seconds, then the implication is that they have crammed 100's of web sites accounts on to the same machine.
              $50 x 100 users = $5000 per month per machine. Makes you think they could afford to spend the $60 on additional RAM as a one off cost.

              Comment

              Working...
              X