You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an application which visualizes 4 matrices ,which get updated a lot, around 50 times a second.
When I observer the application in the task manager, sometimes it runs with 200mb of memory continuously, but on other occasions, it will just eat all the 64 GB of RAM that I have, making the system quite unresponsive.
When I profile the application, all of them RAM usage is invisible to me, so I am suspecting that its some internal imgui handling with the textures that do not get freed, or don't get freed fast enough.
I have attached a code sample. It sometimes works for me. You can see it mostly sitting around 100MB, but it sometimes goes up to 500MB.
Again, in the real application I render much more data, so the issue occurs more often.
I tried to find a way to manually "release" the image, but this functionality is not exposed.
Any ideas or mitigations would be greatly appreciated.
Best Regards
Code example
main.go
package main
import (
"crypto/rand""image""image/color""github.com/AllenDang/giu"
)
vartexture*giu.Texturefuncloop() {
giu.Window("window 1").Layout(
giu.Image(texture).Size(512, 512),
)
}
funcRenderImage(img*image.RGBA) {
buf:=make([]byte, 3)
forx:=0; x<256; x++ {
fory:=0; y<256; y++ {
rand.Read(buf)
img.Set(x, y^255, color.NRGBA{
R: uint8(buf[0]), G: uint8(buf[1]),
B: uint8(buf[2]), A: 255,
})
}
}
}
funcmain() {
wnd:=giu.NewMasterWindow("windows [DEMO]", 640, 480, 0)
gofunc() {
img:=image.NewRGBA(image.Rect(0, 0, 256, 256))
for {
RenderImage(img)
giu.NewTextureFromRgba(img, func(tex*giu.Texture) {
/* we have to find a way to release the texture here */texture=tex/* do we leak here ?*/
})
giu.Update()
}
}()
wnd.Run(loop)
}
To Reproduce
Run my demo
See memory usage spike sometimes
If the spike rises fast enough, the system will start swapping and memory usage just starts to climb without going down until I kill the application
Version
v0.6.2
OS
Windows 10
The text was updated successfully, but these errors were encountered:
What happend?
I have an application which visualizes 4 matrices ,which get updated a lot, around 50 times a second.
When I observer the application in the task manager, sometimes it runs with 200mb of memory continuously, but on other occasions, it will just eat all the 64 GB of RAM that I have, making the system quite unresponsive.
When I profile the application, all of them RAM usage is invisible to me, so I am suspecting that its some internal imgui handling with the textures that do not get freed, or don't get freed fast enough.
I have attached a code sample. It sometimes works for me. You can see it mostly sitting around 100MB, but it sometimes goes up to 500MB.
Again, in the real application I render much more data, so the issue occurs more often.
I tried to find a way to manually "release" the image, but this functionality is not exposed.
Any ideas or mitigations would be greatly appreciated.
Best Regards
Code example
main.go
To Reproduce
Version
v0.6.2
OS
Windows 10
The text was updated successfully, but these errors were encountered: