Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory leak tests #258

Closed
wants to merge 1 commit into from
Closed

Conversation

myaaaaaaaaa
Copy link

Add memory leak tests using the snippets in #257 as a starting point.

These take the form of benchmarks that fail on excessive memory usage (determined by an environment variable MEM_THRESHOLD), which makes detection simple (just run go test -bench) and investigation straightforward using standard Go profiling tools:

go test -bench=Leak/select -memprofile leak.prof
go tool pprof gojq.test leak.prof

Additionally, make test now also runs these tests so that memory leaks can be found by CI. See the failing checks below for details.

@itchyny
Copy link
Owner

itchyny commented Aug 28, 2024

Even after improving the memory consumption, I'm not planning to include this kind of test, so closing.

@itchyny itchyny closed this Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants