-
Notifications
You must be signed in to change notification settings - Fork 18k
image: Massive Ram usage on image.NewRGBA #46732
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
Comments
This seems to be the GC working as expected, if you really need the memory you can force GC runs Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For questions please refer to https://github.com/golang/go/wiki/Questions |
Force running GC will not do anything. but anyways, thanks. |
forcing GC does free up space: $ GODEBUG=gctrace=1 ./testrepo-473
gc 1 @0.003s 4%: 0.13+0.24+0.002 ms clock, 0.54+0.062/0.080/0.17+0.011 ms cpu, 56->56->56 MB, 57 MB goal, 4 P
gc 2 @5.016s 0%: 0.017+0.19+0.003 ms clock, 0.071+0.084/0.085/0.020+0.012 ms cpu, 112->112->56 MB, 113 MB goal, 4 P (forced)
gc 3 @5.017s 0%: 0.023+0.30+0.002 ms clock, 0.093+0/0.10/0.097+0.008 ms cpu, 56->56->0 MB, 112 MB goal, 4 P (forced)
gc 4 @5.017s 0%: 0.023+0.70+0.022 ms clock, 0.095+0/0.15/0.60+0.090 ms cpu, 0->0->0 MB, 4 MB goal, 4 P (forced)
gc 5 @10.029s 0%: 0.033+0.38+0.077 ms clock, 0.13+0.21/0.18/0.15+0.31 ms cpu, 56->56->56 MB, 57 MB goal, 4 P
gc 6 @10.030s 0%: 0.029+0.22+0.005 ms clock, 0.11+0/0.16/0.28+0.022 ms cpu, 56->56->0 MB, 112 MB goal, 4 P (forced)
gc 7 @10.031s 0%: 0.052+0.42+0.004 ms clock, 0.21+0/0.18/0.64+0.016 ms cpu, 0->0->0 MB, 4 MB goal, 4 P (forced)
gc 8 @15.016s 0%: 0.018+0.21+0.002 ms clock, 0.075+0.090/0.081/0.032+0.010 ms cpu, 56->56->56 MB, 57 MB goal, 4 P (forced)
gc 9 @15.016s 0%: 0.033+0.12+0.001 ms clock, 0.13+0/0.12/0.051+0.006 ms cpu, 56->56->0 MB, 112 MB goal, 4 P (forced)
gc 10 @15.017s 0%: 0.027+0.086+0.002 ms clock, 0.10+0/0.069/0.086+0.008 ms cpu, 0->0->0 MB, 4 MB goal, 4 P (forced)
gc 11 @20.019s 0%: 0.020+0.15+0.062 ms clock, 0.080+0.093/0.038/0.057+0.25 ms cpu, 56->56->56 MB, 57 MB goal, 4 P
gc 12 @20.019s 0%: 0.028+0.077+0.002 ms clock, 0.11+0/0.069/0.11+0.008 ms cpu, 56->56->0 MB, 112 MB goal, 4 P (forced)
gc 13 @20.020s 0%: 0.033+0.094+0.001 ms clock, 0.13+0/0.052/0.090+0.006 ms cpu, 0->0->0 MB, 4 MB goal, 4 P (forced) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
As I tested with 1.14.15 and 1.15.13, in 1.15 there was the exact same issue but in 1.14 it was less visible
What operating system and processor architecture are you using (
go env
)?Windows 10 Pro 64bit (version 21H1)
Also code checked on Ubuntu 20.04 btw
go env
OutputWhat did you do?
A small part of the code (also the main issue) was something like this:
https://play.golang.org/p/0mkjppbKZVp
What did you expect to see?
I expected 0 ram usage because it was useless at that moment and function was closed,
Also, yes I can accept the first ~60 MiB Ram usage, but the second time I don't think could be normal
What did you see instead?
The first time used ~60 MiB ram even function was closed and I didn't use that image,
The second time it used ~60 MiB more ram, And Third, Fourth, ... time had the same usage as the second time.
What you want now?
I am a newbie Go developer, so I don't know a lot of things...
If there is a way to fix my code, please suggest to I use it, I have more than 1GB Ram usage only because of this.
In my opinion, it would be cool if something like
.Close()
to force removing the whole image from memory be added in the next updates, or... I don't know...Thanks for reading and helps.
The text was updated successfully, but these errors were encountered: