Page 1 of 1

Bug related to APC, solved

Posted: Sun Mar 04, 2012 11:27 pm
by indigoe
It appears that loading the database into memory will fail silently if there is not enough room left in APC cache.

This resulted in a lot of "There is no device with id [generic] in wurfl" errors and was a bit tricky to track down.

The default cache size is 32MB set by apc.shm_size in php.ini. Increasing this to 64MB minimum will solve the problem. I recommend mentioning this somewhere in the documentation.

I updated the save() function in Storage/Apc.php

Code: Select all

    public function save($objectId, $object) {
        $value = apc_store($this->encode($this->apcNameSpace(), $objectId), $object, $this->expire());
        if ($value === false)
        {
        	throw new WURFL_Xml_PersistenceProvider_Exception ("Error saving variable in apc cache. Cache may be full.");
        }
    }

Re: Bug related to APC, solved

Posted: Sun Mar 04, 2012 11:37 pm
by kamermans
Thanks for the info - we will include a warning about using volatile storage as a persistence mechanism in the documentation, and give a recommended cache size!