-
Notifications
You must be signed in to change notification settings - Fork 689
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
Looks like there is a memory leak #1780
Comments
|
@abhinavdangeti Can you guide me to solve this memory leak problem? After one night's operation, the memory gradually increased to 100G I build indexes in batches, with 2000 entries each time And that's it |
After several analyses, it is determined that there is a memory leak
|
@mschoch @abhinavdangeti @sreekanth-cb |
@hktalent You mention that you're batching your documents into the bleve.Index. Would you share the exact snippet of code where you're doing this. |
We've seen a similar report elsewhere as well - we're trying to understand the root cause for this at the moment. |
+ Initializing the ceiling to 10MB. This means that at least 10 MB of space is guaranteed if the estimate is larger than that. Any additional space will be allocated on demand. + Intended to address: blevesearch/bleve#1780
|
@abhinavdangeti
After, the problem still exists, thank you
|
Without the docs, that code snippet you've shared will not help me reproduce the problem :) Would you add this line in your application somewhere (maybe after indexing every 10 or so batches) and let us know of the behavior you observe ..
This forces a garbage collection followed by an attempt to return as much memory to the operating system as possible. See https://pkg.go.dev/runtime/debug#FreeOSMemory |
@hktalent any chance you could accommodate this -
Or is your last profile with this in place already? |
I added debug.FreeOSMemory() Memory is still growing. Tomorrow I will grab another profile.pb.gz to have a look |
Also, something else to test would be to limit the amount of memory used by your application with : https://pkg.go.dev/runtime/debug#SetMemoryLimit . |
@abhinavdangeti
|
|
Hello, @hktalent! Could you please advise what ended up solving the problem? I'm facing the exact same problem |
profile.pb.gz
go tool pprof -http=:9999 profile.pb.gz
The text was updated successfully, but these errors were encountered: