TYPO3CMS
9.5
Main Page
Related Pages
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Files
File List
File Members
All
$
d
e
r
u
Functions
Variables
$
e
r
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
MemoryUtility.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types = 1);
3
4
namespace
TYPO3\CMS\Adminpanel\Utility
;
5
6
/*
7
* This file is part of the TYPO3 CMS project.
8
*
9
* It is free software; you can redistribute it and/or modify it under
10
* the terms of the GNU General Public License, either version 2
11
* of the License, or any later version.
12
*
13
* For the full copyright and license information, please read the
14
* LICENSE.txt file that was distributed with this source code.
15
*
16
* The TYPO3 project - inspiring people to share!
17
*/
18
19
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
20
26
class
MemoryUtility
27
{
28
private
const
MINIMAL_PERCENT_OF_FREE_MEMORY
= 0.30;
29
38
public
static
function
isMemoryConsumptionTooHigh
(): bool
39
{
40
$iniLimit = ini_get(
'memory_limit'
);
41
$memoryLimit = $iniLimit ===
'-1'
? -1 : GeneralUtility::getBytesFromSizeMeasurement($iniLimit);
42
$freeMemory = $memoryLimit - memory_get_usage(
true
);
43
44
return
$memoryLimit > 0 && $freeMemory < (self::MINIMAL_PERCENT_OF_FREE_MEMORY * $memoryLimit);
45
}
46
}
TYPO3\CMS\Adminpanel\Utility
Definition:
MemoryUtility.php:4
TYPO3\CMS\Adminpanel\Utility\MemoryUtility\MINIMAL_PERCENT_OF_FREE_MEMORY
const MINIMAL_PERCENT_OF_FREE_MEMORY
Definition:
MemoryUtility.php:28
TYPO3\CMS\Adminpanel\Utility\MemoryUtility\isMemoryConsumptionTooHigh
static bool isMemoryConsumptionTooHigh()
Definition:
MemoryUtility.php:38
TYPO3\CMS\Core\Utility\GeneralUtility
Definition:
GeneralUtility.php:45
TYPO3\CMS\Adminpanel\Utility\MemoryUtility
Definition:
MemoryUtility.php:27
doxygen
typo3
sysext
adminpanel
Classes
Utility
MemoryUtility.php
Generated on Tue Oct 5 2021 01:56:48 for TYPO3CMS by
1.8.18