Skip to content

Instantly share code, notes, and snippets.

View gkampitakis's full-sized avatar
🙉
Debugging

Georgios Kampitakis gkampitakis

🙉
Debugging
View GitHub Profile
@gkampitakis
gkampitakis / time-ticker.go
Created February 18, 2024 14:20
Memory leaks in Go - Not stopping time.Ticker
func main() {
for {
ticker := time.NewTicker(1 * time.Second)
// do something with the ticker
_ = <-ticker.C
// stop the ticker to release associated resources
ticker.Stop()
}
}
# apt-get update && apt-get install -y curl host dnsutils nano netcat
apiVersion: v1
kind: Pod
metadata:
name: toolbox-pod
namespace: client
spec:
restartPolicy: Always
containers:
- name: toolbox