Selaa lähdekoodia

Reset grokky once all patterns are compiled as we do not need to hold them in memoory (#2420)

Laurence Jones 1 vuosi sitten
vanhempi
commit
ff7acd3347
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      pkg/parser/unix_parser.go

+ 7 - 1
pkg/parser/unix_parser.go

@@ -148,6 +148,12 @@ func LoadParsers(cConfig *csconfig.Config, parsers *Parsers) (*Parsers, error) {
 		parsers.Ctx.Profiling = true
 		parsers.Povfwctx.Profiling = true
 	}
-
+	/*
+		Reset CTX grok to reduce memory footprint after we compile all the patterns
+	*/
+	parsers.Ctx.Grok = grokky.Host{}
+	parsers.Povfwctx.Grok = grokky.Host{}
+	parsers.StageFiles = []Stagefile{}
+	parsers.PovfwStageFiles = []Stagefile{}
 	return parsers, nil
 }