Skip to content

Large memory growth in long running processes #29

@nickzelei

Description

@nickzelei

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.

heap

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.
image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions