I have a sample go snippet which pulls 50k rows from source DB and inserts into target DB. https://go.dev/play/p/IVANZyVUbkm
While doing so I create a empty slice and add operations to it. When the length of slice is > 10K, I do a bulk write to DB.
The problem here is this script eats more memory as it runs, I suspect issue is with the slice which gets appended periodically. I try to do a copy as suggested in few articles and reset it but it never gives up on the memory and the script consumes more and more as it runs.
Any idea as to who to release the memory of slice every 10k docs ?
I have reset the slice, but memory is not returned back.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/Zsyqz8zgxvf8cjYE%40basil.wdw.
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/Vw04RLUpRcc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAE-6Q_LOLc1is5ybZbW3D2jVvnnc4QerQZt4aWXz2RMeqOHZow%40mail.gmail.com.