-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Heyo!
First off, great project! We are parsing postgres queries in Go and came across this via sqlc due to not wanting to add a CGO dependency.
This for the most part works great, however, it seems to have a large amount of memory growth when running in a long running process.
Below is a heap snapshot from calling it four times.
Not doing anything crazy here, just passing in a sql statement so that we can qualify where conditions with their respective schema and table.
Maybe we're doing something wrong, but I am seeing massive memory growth correlated to the amount of calls we make to this library.
What makes it even more difficult is that it doesn't seem to free the memory for 10 minutes.
Here's an snapshot of some memory consumption I clocked when running it.

You can see how we're calling it here:
https://github.com/nucleuscloud/neosync/blob/main/worker/pkg/query-builder2/querybuilder.go#L263
