Answer the question
In order to leave comments, you need to log in
Decoder xml eats up memory. What is the problem and how to solve it?
Hello!
There is a function that I use in a loop, it eats up memory:
func decoderXml(f *zip.File) Text {
d := Text{}
r, err := f.Open()
if err != nil {
fmt.Println(err)
}
defer r.Close()
decoder := xml.NewDecoder(r)
decoder.CharsetReader = charset.NewReaderLabel
err = decoder.Decode(&d)
if err != nil {
fmt.Printf("Error: %v",err)
}
return d
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question