Commit d9d5bbb
authored
allow yaml parser and visitor to be garbage collected (#104)
When loading a YAML dictionary the YamlFile class will store a YAML visitor and a parser.
This means that after "read_file_into_dictionary" is called the Psych:Parser will keep the object tree that was used to parse and navigate the YAML document, even after the resulting Hash dictionary is created.
While the memory required to parse the YAML dictionary is still required, we can change the YamlFile class to allow the Psych::Parser garbage collection, freeing a significant amount of memory from the heap.1 parent 31d4484 commit d9d5bbb
File tree
3 files changed
+10
-7
lines changed- lib/logstash/filters/dictionary
3 files changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 11 | + | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments