You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assume string(w.buff.Bytes()) = "<br" and run into function at first loop
1.// First check if we have processed this element before.2.w.collector.mu.RLock()
3.// See https://github.com/dominikh/go-tools/issues/7234.//lint:ignore S1030 This construct avoids memory allocation for the string.5.seen:=w.collector.elementSet[string(w.buff.Bytes())]
6.w.collector.mu.RUnlock()
7.ifseen {
8.w.buff.Reset()
9.continue10. }
11.s:=w.buff.String()
12.13.w.buff.Reset()
14.15.ifstrings.HasPrefix(s, "</") {
16.continue17. }
18.19.s, tagName:=w.insertStandinHTMLElement(s)
20.el:=parseHTMLElement(s)
21.el.Tag=tagName22.23.w.collector.mu.Lock()
24.w.collector.elementSet[s] =true25.ifel.Tag!="" {
26.w.collector.elements=append(w.collector.elements, el)
27. }
28.w.collector.mu.Unlock()
line 5: checking map key "<br"
line 19: key was overwrite from "<br" into "<div"
line 24: overwrite key was added to map "<div"
This is causing memory go to from 1.5GB to 4GB from my case.
The text was updated successfully, but these errors were encountered:
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
issue came from #7320
At function
Assume
string(w.buff.Bytes()) = "<br"
and run into function at first loopline 5: checking map key "<br"
line 19: key was overwrite from "<br" into "<div"
line 24: overwrite key was added to map "<div"
This is causing memory go to from 1.5GB to 4GB from my case.
The text was updated successfully, but these errors were encountered: