| Total Complexity | 3 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | class MemoryUtility |
||
| 27 | { |
||
| 28 | private const MINIMAL_PERCENT_OF_FREE_MEMORY = 0.30; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Checks memory usage used in current process - this is no guarantee for not running out of memory |
||
| 32 | * but should prevent memory exhaustion due to the admin panel in most cases. |
||
| 33 | * The loggers will stop logging once the amount of free memory falls below the threshold (see |
||
| 34 | * MINIMAL_PERCENT_OF_FREE_MEMORY const). |
||
| 35 | * |
||
| 36 | * @return bool |
||
| 37 | */ |
||
| 38 | public static function isMemoryConsumptionTooHigh(): bool |
||
| 47 |