nginxinc / nginx-go-crossplane

A library for working with NGINX configs in Go
Apache License 2.0
46 stars 12 forks source link

fix: Memory leak caused by openFile and osOpen functions #102

Closed oliveromahony closed 1 month ago

oliveromahony commented 1 month ago

Proposed changes

The parse function was leaking memory. On analysis of the code it looked like the fileOpen function was keeping the memory active, after the file was being used.

A snapshot of the memory in the NGINX Agent before these changes: image

and after: image

Checklist

Before creating a PR, run through this checklist and mark each as complete.