Skip to content

Commit

Permalink
[VUFIND-1505] Avoid cache-related out-of-memory exceptions. (#2137)
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Sep 20, 2021
1 parent 73bd85e commit 8fb51ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion module/VuFind/src/VuFind/View/Helper/Root/IconFactory.php
Expand Up @@ -70,8 +70,12 @@ public function __invoke(
}
$config = $container->get(\VuFindTheme\ThemeInfo::class)
->getMergedConfig('icons', true);
// As of release 1.1.0, the memory storage adapter has a flaw which can cause
// unnecessary out of memory exceptions when a memory limit is enabled; we
// can disable these problematic checks by setting memory_limit to -1.
$cacheConfig = ['name' => 'memory', 'options' => ['memory_limit' => -1]];
$cache = $container->get(\Laminas\Cache\Service\StorageAdapterFactory::class)
->createFromArrayConfiguration(['name' => 'memory', 'options' => []]);
->createFromArrayConfiguration($cacheConfig);
$helpers = $container->get('ViewHelperManager');
return new $requestedName(
$config,
Expand Down

0 comments on commit 8fb51ac

Please sign in to comment.