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
Hello, I'm having a problem very similar to issue #1046. The code is really simple, but the memory consumption is increasing by roughly 60kb/s, and it will reach over 1.5GB if given enough time.
I've also found other somewhat similar issues, namely #454 and #552, but they don't seem appliable as I have confirmed I have a single Chrome window unlike #454, and I'm not trying to cancel the browser context like #552.
What versions are you running?
$ go list -m github.com/chromedp/chromedpgithub.com/chromedp/chromedp v0.9.3
$ google-chrome --versionVersion 121.0.6167.185 (Official Build) (64-bit)
$ go versiongo version go1.22.0 windows/amd64
What did you do? Include clear steps.
This is my current code. Start is called once to initialize the context and inject the JS function, while Get and Post are called in a loop to call the function injected during initialization.
#1046 mentions the use of runtime.ReleaseObject as the solution to the problem, or the use of string as a return value. I am already using a string, so I tried changing it to a *runtime.RemoteObject and manually releasing it, however it made the problem worse, with the memory usage increasing to about 1Mb/s.
DevTools debugging didn't give much insight except that there were a number of Window contexts and detached XMLDocuments, but I couldn't really trace their origin, nor could I find something in the code that could be causing these to be left behind.
Originally the code would navigate to the URL and inject both JS function body and function call for each request and that resulted in a 1Mb/s memory increase. Changing to a single Evaluate with just the function call each run has improved it, but even with the reduced leak the memory usage reaches 1GB in just a little over a day of execution.
What did you expect to see?
Stable memory usage across the entire execution.
What did you see instead?
Rapid memory use increase
The text was updated successfully, but these errors were encountered:
Hello, I'm having a problem very similar to issue #1046. The code is really simple, but the memory consumption is increasing by roughly 60kb/s, and it will reach over 1.5GB if given enough time.
I've also found other somewhat similar issues, namely #454 and #552, but they don't seem appliable as I have confirmed I have a single Chrome window unlike #454, and I'm not trying to cancel the browser context like #552.
What versions are you running?
What did you do? Include clear steps.
This is my current code.
Start
is called once to initialize the context and inject the JS function, whileGet
andPost
are called in a loop to call the function injected during initialization.#1046 mentions the use of
runtime.ReleaseObject
as the solution to the problem, or the use ofstring
as a return value. I am already using a string, so I tried changing it to a*runtime.RemoteObject
and manually releasing it, however it made the problem worse, with the memory usage increasing to about 1Mb/s.DevTools debugging didn't give much insight except that there were a number of
Window
contexts and detachedXMLDocument
s, but I couldn't really trace their origin, nor could I find something in the code that could be causing these to be left behind.Originally the code would navigate to the URL and inject both JS function body and function call for each request and that resulted in a 1Mb/s memory increase. Changing to a single
Evaluate
with just the function call each run has improved it, but even with the reduced leak the memory usage reaches 1GB in just a little over a day of execution.What did you expect to see?
Stable memory usage across the entire execution.
What did you see instead?
Rapid memory use increase
The text was updated successfully, but these errors were encountered: