Jump to:

3430 Posts in 1057 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Problems with Sapphire > JSMin

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

Page: 1
Go to End
Author Topic: 1949 Views
  • Gringa
    Avatar
    Community Member
    11 Posts

    Problems with Sapphire > JSMin Link to this post

    Help urgently needed. I am unable to log into the CMS.
    Upon entering the user name and password, I received the following error:

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 24 bytes) in /home/[clientname]/public_html/sapphire/thirdparty/jsmin/JSMin.php on line 144.

    I increased the hosting memory allocation, but this hasn't helped.
    I deleted image files I had uploaded to the CMS, but this hasn't helped.

    What is JSMin and how do I change the memory allocation?

    Here is what is on line 144 in the JSMin.php file:

    142 if ($c === null) {
    143 if ($this->inputIndex < $this->inputLength) {
    144 $c = $this->input[$this->inputIndex];
    145 $this->inputIndex += 1;

    Many thanks!

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Problems with Sapphire > JSMin Link to this post

    Hi Gringa

    This is from a lack of memory. When you say you upped it on your server are you sure it worked? if it did the memory size in the error would reflect that.
    Try putting this at the top of your sapphire/main.php

    ini_set('memory_limit', '64M');

    that will force your memory to 64MB unless your host is limiting it to 32MB.

  • Gringa
    Avatar
    Community Member
    11 Posts

    Re: Problems with Sapphire > JSMin Link to this post

    Thank you for your reply!

    I have not yet been able to get to the CMS admin area today.

    I tried changing the JSMin file to 64M and the error message did reflect the changed size (the "24 bytes" in the error message increased). I then closed the admin and ran the dev/build (I'm running RC 2.3.0). Returning to the Admin led to an indefinite hang at the "SilverStripe is loading" stage.

    I next changed the 64M to 45, thinking maybe the increased memory allocation to JSMin was causing the CMS to hog too much memory, though the same thing happened.

    I changed the JSMin back to 64M and also now added "ini_set('memory_limit', '64M');" to the bottom of the main.php file in the Sapphire directory. Returning to the admin leads to another indefinite hang at the same "SilverStripe is loading" stage.

    I'm at a loss.

    On the hosting side of things, I'm running my own php.ini, set to 128M (instead of the default 32M). Checking my overall hosting limits, I'm only at 2% of my bandwidth and 1% of my allocated drive space.

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Problems with Sapphire > JSMin Link to this post

    I would leave JSMin out of it, its just a generic memory error which happened to use up all the memory while running that script, I would set that back to how it was when you opened it and just concentrate on getting your memory allowance up to 64MB.

    Put that line at the TOP of main.php, not the bottom. Also I guess ur custom php.ini is not working coz if you had 128M of memory you wouldn't be getting an error saying it ran out at 32M. And when I say the change would be reflected in the error I mean the other number, it would have something like 67554432 bytes (around 64MB) instead of the 32MB that you are currently getting.

    Basically your problem is that SS cant access more than 32MB of memory. This has nothing to do with your storage and bandwidth allowances, its the RAM which is on the host machine. If you are on a shared host, it is very unlikely that they will allow you to go over 64M, so try setting that in your php.ini or just delete that line and let the main.php take care of it with the line I gave you in my previous post.

  • Beck
    Avatar
    Community Member
    23 Posts

    Re: Problems with Sapphire > JSMin Link to this post

    i solve this problem in this way:
    1. i changed "memory_limit = 128M" in "php.ini"
    2. then added "SetEnv PHPRC /*full_dir_patch*/php.ini" in "public_html/.htaccess" <-- it means that all php configuration from this file

    1949 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.