Skip to content

Long-running go application experiencing memory leak using rod #1124

Closed Answered by davidberetta
davidberetta asked this question in Q&A
Discussion options

You must be logged in to vote

I managed to find the problem and solve it. In case anyone else experiences this issue or similar, here is the solution.

  1. To prevent chrome_crashpad from running, I had to launch the browser with the following flags:
    .Set("--single-process").Set("--disable-crashpad-for-testing")

  2. I used the following flags to ensure chrome releases memory when pages are closed:
    .Set("--aggressive-tab-discard").Set("--aggressive-cache-discard")

  3. I had to call .Close() on any new page (NOTE: closing the browser in rod does not seems to release the memory from pages that are not closed by calling .Close().

  4. Finally, after calling .Close() on the browser, you have to call .CleanUp() on the launcher. It se…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by davidberetta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant