File tree 2 files changed +15
-2
lines changed
Bundle/WebProfilerBundle/Resources/views/Collector
Component/HttpKernel/DataCollector
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 10
10
{% set text %}
11
11
<div class =" sf-toolbar-info-piece" >
12
12
<b >Memory usage</b >
13
- <span >{{ ' %.1f' | format (collector .memory / 1024 / 1024 ) }} MB</span >
13
+ <span >{{ ' %.1f' | format (collector .memory / 1024 / 1024 ) }} / {{ collector . memoryLimit == -1 ? ' ∞ ' : collector . memoryLimit }} MB</span >
14
14
</div >
15
15
{% endset %}
16
16
{% include ' @WebProfiler/Profiler/toolbar_item.html.twig' with { ' link' : false } %}
Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ class MemoryDataCollector extends DataCollector
23
23
{
24
24
public function __construct ()
25
25
{
26
- $ this ->data = array ('memory ' => 0 );
26
+ $ this ->data = array (
27
+ 'memory ' => 0 ,
28
+ 'memory_limit ' => rtrim (ini_get ('memory_limit ' ), 'M ' )
29
+ );
27
30
}
28
31
29
32
/**
@@ -44,6 +47,16 @@ public function getMemory()
44
47
return $ this ->data ['memory ' ];
45
48
}
46
49
50
+ /**
51
+ * Gets the PHP memory limit.
52
+ *
53
+ * @return integer The memory limit
54
+ */
55
+ public function getMemoryLimit ()
56
+ {
57
+ return $ this ->data ['memory_limit ' ];
58
+ }
59
+
47
60
/**
48
61
* Updates the memory usage data.
49
62
*/
You can’t perform that action at this time.
0 commit comments