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

Find memory leak #1

Open
JasonLovesDoggo opened this issue Jul 6, 2024 · 3 comments
Open

Find memory leak #1

JasonLovesDoggo opened this issue Jul 6, 2024 · 3 comments

Comments

@JasonLovesDoggo
Copy link
Owner

systems reach 512mb of memory after ~1w of operation, check stats modules to ensure no leaks.

there seems to be one somewhere

@JasonLovesDoggo
Copy link
Owner Author

2024/12/20 23:50:14 [Recovery] 2024/12/20 - 23:50:14 panic recovered:
error
runtime error: invalid memory address or nil pointer dereference
error
/usr/local/go/src/runtime/panic.go:261 (0x4506d7)

/usr/local/go/src/runtime/signal_unix.go:881 (0x4506a5)
info
/usr/local/go/src/runtime/memmove_amd64.s:200 (0x46f121)
info
/usr/local/go/src/runtime/slice.go:261 (0x451dfd)
info
/go/pkg/mod/github.com/tom-draper/api-analytics/analytics/go/[email protected]/core.go:50 (0x99a35e)
info
/go/pkg/mod/github.com/tom-draper/api-analytics/analytics/go/[email protected]/analytics.go:40 (0x99d536)

see tom-draper/api-analytics#53

issue is with

JasonLovesDoggo added a commit that referenced this issue Mar 2, 2025
- Implemented proper cleanup of client connections in the SSE
  handler to prevent goroutine leaks.
- Added buffered channels to the ValueEventServer to prevent
  blocking and improve concurrency handling.
- Improved client disconnection handling in the SSE route to
  ensure prompt cleanup of disconnected clients.
- Added explicit timeout mechanisms in tests to avoid indefinite
  hanging.
- Updated test script to include a mix of connection types
  (quick, lingering, and zombie) to simulate real-world
  scenarios.
- Updated documentation and added test results.
- Bumped version to 1.4.0.

Fixes GHSA-vh64-54px-qgf8
potential fix for #1
@JasonLovesDoggo
Copy link
Owner Author

see GHSA-vh64-54px-qgf8

@JasonLovesDoggo
Copy link
Owner Author

Looks like GHSA-vh64-54px-qgf8 Was the root caused. Will wait 1 more week to confirm it was the root cause

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

No branches or pull requests

1 participant