@@ -60,6 +60,14 @@ class HeapStatistics
60
60
* @var bool
61
61
*/
62
62
private $ does_zap_garbage ;
63
+ /**
64
+ * @var float
65
+ */
66
+ private $ number_of_native_contexts ;
67
+ /**
68
+ * @var float
69
+ */
70
+ private $ number_of_detached_contexts ;
63
71
64
72
/**
65
73
* @param float $total_heap_size
@@ -69,7 +77,10 @@ class HeapStatistics
69
77
* @param float $used_heap_size
70
78
* @param float $heap_size_limit
71
79
* @param float $malloced_memory
80
+ * @param float $peak_malloced_memory
72
81
* @param bool $does_zap_garbage
82
+ * @param float $number_of_native_contexts
83
+ * @param float $number_of_detached_contexts
73
84
*/
74
85
public function __construct (
75
86
float $ total_heap_size ,
@@ -80,17 +91,21 @@ public function __construct(
80
91
float $ heap_size_limit ,
81
92
float $ malloced_memory ,
82
93
float $ peak_malloced_memory ,
83
- bool $ does_zap_garbage
94
+ bool $ does_zap_garbage ,
95
+ float $ number_of_native_contexts ,
96
+ float $ number_of_detached_contexts
84
97
) {
85
- $ this ->total_heap_size = $ total_heap_size ;
86
- $ this ->total_heap_size_executable = $ total_heap_size_executable ;
87
- $ this ->total_physical_size = $ total_physical_size ;
88
- $ this ->total_available_size = $ total_available_size ;
89
- $ this ->used_heap_size = $ used_heap_size ;
90
- $ this ->heap_size_limit = $ heap_size_limit ;
91
- $ this ->malloced_memory = $ malloced_memory ;
92
- $ this ->peak_malloced_memory = $ peak_malloced_memory ;
93
- $ this ->does_zap_garbage = $ does_zap_garbage ;
98
+ $ this ->total_heap_size = $ total_heap_size ;
99
+ $ this ->total_heap_size_executable = $ total_heap_size_executable ;
100
+ $ this ->total_physical_size = $ total_physical_size ;
101
+ $ this ->total_available_size = $ total_available_size ;
102
+ $ this ->used_heap_size = $ used_heap_size ;
103
+ $ this ->heap_size_limit = $ heap_size_limit ;
104
+ $ this ->malloced_memory = $ malloced_memory ;
105
+ $ this ->peak_malloced_memory = $ peak_malloced_memory ;
106
+ $ this ->does_zap_garbage = $ does_zap_garbage ;
107
+ $ this ->number_of_native_contexts = $ number_of_native_contexts ;
108
+ $ this ->number_of_detached_contexts = $ number_of_detached_contexts ;
94
109
}
95
110
96
111
/**
@@ -166,4 +181,22 @@ public function doesZapGarbage(): bool
166
181
{
167
182
return $ this ->does_zap_garbage ;
168
183
}
184
+
185
+ /**
186
+ * The total number of native contexts object on the heap
187
+ * @return float
188
+ */
189
+ public function getNumberOfNativeContexts (): float
190
+ {
191
+ return $ this ->number_of_native_contexts ;
192
+ }
193
+
194
+ /**
195
+ * The total number of native contexts that were detached but were not garbage collected yet
196
+ * @return float
197
+ */
198
+ public function getNumberOfDetachedContexts (): float
199
+ {
200
+ return $ this ->number_of_detached_contexts ;
201
+ }
169
202
}
0 commit comments