-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
High memory usage on bigger images #13
Comments
Thanks for reporting this. My understanding of the Go garbage collector is that everything allocated by the To aid in reproducing the issue, could you explain how you were measuring the memory usage? |
It looks to me like a memory leak, as GC should free most of the memory allocated.
Yes, this is from only one iteration of This is an GC output of the reproducer with one iteration cycle set:
|
I've also experimented with Here's an output from
This shows the cumulative CPU time taken by child functions executed by the |
I've simply used |
Thanks for all these logs. I'll start investigating the memory profiling. |
Also: update test CI, add benchmark For #13
After some code changes (see eedcc4d), this is the GC output for your code, with the original 4 loop cycles set.
This shows a ~70% memory use reduction, and to me indicates no memory leaks across runs. If you think this is reasonable, I'll close this issue and make a new release. Otherwise let me know where you think further issues are. |
Yep, it looks reasonable to me. Thanks for fixing this! |
The latest release, v2.4.0, incorporates this change. |
I've noticed recently that
dither
uses ~500MB of RAM when dithering an example 3414x1920 image and it doesn't appear to run through a garbage collection after dithering.Is this an expected behavior? If yes, could it be somehow reduced?
Minimal reproducer:
Note
Minimal reproducer does a dithering operation four times to show that the allocated memory is exponentially higher in subsequent iterations.
The text was updated successfully, but these errors were encountered: