Commit 2a952fe
authored
frankenphp-symfony: call gc_collect_cycles() after handling request (#142)
Triggering the garbage collector after the request has been handled and
when the worker may be idle prevents the garbage collection from being
randomly done in the middle of the handling of a request (which delays
the delivery of the HTTP response).
Another option, that is done by Laravel Octone, is to trigger the GC
when a configurable amount of memory has been consumed instead of after
every request.
I think this patch is good enough for FrankenPHP as usually many workers
will be available.1 parent 6c75282 commit 2a952fe
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
22 | 20 | | |
23 | | - | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
| |||
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
| 40 | + | |
| 41 | + | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
0 commit comments