M
M
musicsucks2016-12-14 19:30:02
Task Schedulers
musicsucks, 2016-12-14 19:30:02

PhantomJS + Cron - how to prevent memory overflow?

On the server, it is loaded via phantomjs every 10 minutes of the page.
At the same time, after loading the page, they should be unloaded from memory, and not accumulated.
In fact, PhantomJS processes multiply and the server crashes after a while (500).
Are there canonical ways to kill these processes, for example, through the same cron every hour, so that they do not accumulate?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
musicsucks, 2016-12-18
@musicsucks

As it turns out, PhantomJS has a memory leak - a classic problem.
I solved it by creating a cron task to kill all PhantomJS processes every hour.
A crutch, but everything works without failures.

S
Sergey, 2016-12-15
@spy_reality

It is necessary that there would be page.close(); and exit(); in PhantomJS code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question