Closed evelive3 closed 4 months ago
@evelive3 you need to run it for more than an hour to see if the memory is stable around a certain value.Due to Go's memory model, part of the memory on the heap will be reused
@evelive3 I ran it for two hours and the memory was stable at around 5 MB.
Golang
go1.22.4 windows/amd64
OS
Windows 11 X64 23H2 OS build 22631.3737
OPC DA Server
MatrikonOPCSimulation_v1.7.1.0
操作步骤
将example/subscribe/main.go下载后,执行
go build --ldflags "-s -w" .
编译为exe可执行程序文件并运行现象
刚运行时,内存占用2M 运行10分钟后,内存占用6M
后续还修改了example/read/main.go使之持续运行,也观察到同样的内存使用增加情况,不知道是否与Item的Release方法为空有关? https://github.com/huskar-t/opcda/blob/3c352b9c72cfa1764184e0163f32443b3b484edf/opcitem.go#L228-L230