Closed kolinfluence closed 5 months ago
If you don't want the default pool, just call Release()/ReleaseTimeout()
to close it.
@panjf2000 can you update this example where it doesnt have any mem allocated when doing nothing?
package main
import (
"time"
"github.com/cloudxaas/gosysinfo/mem" //go get -u github.com/cloudxaas/gosysinfo/mem@7a71da0
"github.com/panjf2000/ants/v2"
)
func main() {
ants.Submit(func() { //this doesnt work
cxsysinfomem.LogMemStatsPeriodically(3 * time.Second)
})
select {}
}
Description of new feature
144bytes alloc doing nothing, can iron it out? how to make it 0?
./memalloc Alloc = 139824 B TotalAlloc = 139824 B Sys = 6380560 B NumGC = 0 Alloc = 141208 B TotalAlloc = 141208 B Sys = 6380560 B NumGC = 0 Alloc = 141368 B TotalAlloc = 141368 B Sys = 6380560 B NumGC = 0 Alloc = 141512 B TotalAlloc = 141512 B Sys = 6380560 B NumGC = 0 Alloc = 141672 B TotalAlloc = 141672 B Sys = 6380560 B NumGC = 0
Scenarios for new feature
zero memory allocation when idle
Breaking changes or not?
No
Code snippets (optional)
No response
Alternatives for new feature
None.
Additional context (optional)
None.