Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High memory usage #7

Closed
c0deslinger opened this issue Jul 23, 2023 · 3 comments
Closed

High memory usage #7

c0deslinger opened this issue Jul 23, 2023 · 3 comments

Comments

@c0deslinger
Copy link

Hi, your code is very good and works well, but when I use it the memory usage goes up quite a lot and when the scraping is finished the memory doesn't come back to normal. Are you sure you closed the goroutines when they were finished?

@gosom
Copy link
Owner

gosom commented Jul 27, 2023

thank you @c0deslinger .

The application starts on the background N browsers (chrome). This is memory intensive.

When scraping finishes the application does not exit.

Although indeed I can confirm that memory usage does not drop

smem |grep -w 'google-maps-scraper'

36621 giorgos  ./google-maps-scraper -dept        0   704424   704432   705612

It does not look that any goroutines are still running, but I need to check again the "parent" project scrapemate.

Although, this "problem" does not look a blocker. Even with a large number of queries the memory increases but at some point stops increasing.

you may try to tune the garbage collector frequency (use the GOGC environment variable). I noticed less memory usage when the GC triggers more often.

Also please read this: https://tip.golang.org/doc/gc-guide

The section 'A note about virtual memory', but I am not sure if that's the case here.

this requires deeper investigation since I didn't notice any obvious issue in code.

I will leave the issue open. Maybe someone assists here

@gosom
Copy link
Owner

gosom commented Dec 12, 2023

closing issue because of inactivity

@gosom gosom closed this as completed Dec 12, 2023
@arceushui
Copy link
Contributor

Hi, I'm also facing the high memory issue and I noticed playwright took out a lot of space. I attached my local heap profile for reference and this is after finishing all the jobs and awaiting for jobs.

The high memory issue is also due to ms-playwright but this can't really be resolved
out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants