[TASK] Change APC cache preset condition 43/47043/2
authorThorsten Bringewatt <t.bringewatt@mittwald.de>
Tue, 24 Nov 2015 13:13:18 +0000 (14:13 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 4 Mar 2016 11:25:44 +0000 (12:25 +0100)
This commit removes the check for minimum total apc cache size.
It should be enough to check for at least 5 MB free memory.

Change-Id: Ia8f6d2aaf9030c303534f7c27f2c73479aa4632a
Resolves: #71802
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/47043
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/install/Classes/Configuration/ExtbaseObjectCache/ApcPreset.php
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Configuration/ExtbaseObjectCache/Apc.html

index 018120f..f138508 100644 (file)
@@ -46,8 +46,7 @@ class ApcPreset extends Configuration\AbstractPreset
     );
 
     /**
-     * APC preset is available if extension is loaded, if APC has ~100MB
-     * memory and if ~5MB are free.
+     * APC preset is available if extension is loaded and at least ~5MB are free.
      *
      * @return bool TRUE
      */
@@ -56,12 +55,10 @@ class ApcPreset extends Configuration\AbstractPreset
         $result = false;
         if (extension_loaded('apc')) {
             $memoryInfo = @apc_sma_info();
-            $totalMemory = $memoryInfo['num_seg'] * $memoryInfo['seg_size'];
             $availableMemory = $memoryInfo['avail_mem'];
 
-            // If more than 99MB in total and more than 5MB free
-            if ($totalMemory > (99 * 1024 * 1024)
-                && $availableMemory > (5 * 1024 * 1024)) {
+            // If more than 5MB free
+            if ($availableMemory > (5 * 1024 * 1024)) {
                 $result = true;
             }
         }
index d2ec47f..bd1079e 100644 (file)
@@ -28,9 +28,8 @@
                                speeds up lots of TYPO3 CMS requests. Use if available.
                        </f:then>
                        <f:else>
-                               APC is not loaded or not enough memory is left. APC should
-                               be configured to have at least 100MB of shared memory with
-                               5MB free memory.
+                               APCu is not loaded or not enough memory is left. APCu should
+                               have at least 5MB free memory.
                        </f:else>
                </f:if>
        </div>