Jump to:

4945 Posts in 17703 Topics by 1494 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Memory Allocation Errors

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2280 Views
  • AndrewR
    Avatar
    Community Member
    5 Posts

    Memory Allocation Errors Link to this post

    I've just installed SilverStripe to my host (InMotion Hosting), and after some fussing around I have got to the point where I can log into the CMS. However both the CMS pages and the actual site pages are giving intermittent memory allocation errors.

    Example of a page rendered from the site (actually the default home page), where the memory error is being added after the closing html tag.

    </html>
    <br />
    <b>Fatal error</b>: Allowed memory size of 268435456 bytes exhausted (tried to allocate 480634800 bytes) in <b>Unknown</b> on line <b>0</b><br />

    A similar message shows up in the CMS next to the Save/Publish/Unpublish buttons:
    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 435247024 bytes) in Unknown on line 0

    According to phpinfo() max_memory is set to 256M, so if my understanding of the docs is correct then I shouldn't have a problem. So I suspect I've stuffed something in the installation...

    Any suggestions on where to start looking?

    Environment is:
    Apache 2.2.11
    PHP 5.2.9
    MySQL 5.0.67

  • AndrewR
    Avatar
    Community Member
    5 Posts

    Re: Memory Allocation Errors Link to this post

    Well, it gets stranger.

    Adding an "echo memory_get_usage()" to the end of sapphire/main.php results in showing an acceptable amount of memory used. Much lower than the limit set.

    But the fatal error is still reported afterwards. Thing is, the echo statement is right at the end of main.php, so there really shouldn't be anything else happening afterwards? Also, its not happening consistently. Maybe once out of every 3 pageviews - both in the actual site and using the CMS.

    I've tried re-uploading the SS distribution, with no effect.

    As a beginner SS user, this is puzzling - any suggestions from more experienced users?

  • AndrewR
    Avatar
    Community Member
    5 Posts

    Re: Memory Allocation Errors Link to this post

    Well, sad to say I've given up and switched to Drupal.

    If anyone out there has Silverstripe running on InMotionHosting, I would be very interested in having a chat.

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Memory Allocation Errors Link to this post

    You are running 32mb - this is the minimum requirement to run a basic site. I suggest tho you run it at least 64mb ideally 128mb to run some of the more complex operations will chew through 32mbs quite easily

  • AndrewR
    Avatar
    Community Member
    5 Posts

    Re: Memory Allocation Errors Link to this post

    Thanks for the response, but I am not sure how this can be so.

    php.ini has it set to 256M:

    memory_limit = 256M ; Maximum amount of memory a script may consume (32MB)

    And phpinfo reports:

    memory_limit 256M

    Further, the error message being appended to the page is saying that the script has exhausted 268435456 bytes already, which is 256Mb.

    So I am unsure why you're saying there's only 32Mb running? Can you point me towards whatever else I should be looking at?

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Memory Allocation Errors Link to this post

    256M I believe could be 256 Mega Bits rather then Mega Bytes. Note that in the php.ini comment it has MB (32MB) and you have only used M. 256 mega bits = 32 mega bytes.

  • AndrewR
    Avatar
    Community Member
    5 Posts

    Re: Memory Allocation Errors Link to this post

    Will,

    Thanks again for the suggestion. I checked the PHP documentation, which says:

    The available options are K (for Kilobytes), M (for Megabytes) and G (for Gigabytes; available since PHP 5.1.0), these are case insensitive. Anything else assumes bytes. 1M equals one Megabyte or 1048576 bytes. 1K equals one Kilobyte or 1024 bytes. You may not use these shorthand notations outside of php.ini, instead use an integer value of bytes. See the ini_get() documentation for an example on how to convert these values.

    Further, the error message (see original post at the top) says that the total allocated memory of 256 megabytes (268,435,456 bytes) has been exhausted. So I am fairly confident that I do actually have 256MB (not megabits) configured (and used).

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Memory Allocation Errors Link to this post

    Well the default installation should really not be consuming anywhere near 256mb of Ram. I think your investigations with memory_usage and the fact that it throws the error on an unknown file is really strange! Could be PHP getting itself in a bit of a loopy state. Whats your php configuration / apache module setup? You said in your first post you needed to fuss around to get it to install. Did the installer throw any warnings?

    2280 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.