Cheerio memory error

Hello, I have deployed a CheerioCrawler on AWS, the machine has 2vCPU and 4gb of ram, but I get the following error:
WARN CheerioCrawler:AutoscaledPool:Snapshotter: Memory is critically overloaded. Using 1174 MB of 750 MB (157%). Consider increasing available memory.
WARN CheerioCrawler:AutoscaledPool:Snapshotter: Memory is critically overloaded. Using 1174 MB of 750 MB (157%). Consider increasing available memory.
What can it be ?
2 Replies
Pepa J
Pepa J2y ago
Hello @NeoNomade have you tried setting up and enviromental variable APIFY_MEMORY_MBYTES ? https://docs.apify.com/sdk/js/docs/guides/environment-variables#apify_memory_mbytes
Environment Variables | Apify Documentation
The following is a list of the environment variables used by Apify SDK that are available to the user.
NeoNomade
NeoNomadeOP2y ago
fixed it like this:
const config = Configuration.getGlobalConfig();
config.set('availableMemoryRatio', 0.95)
const config = Configuration.getGlobalConfig();
config.set('availableMemoryRatio', 0.95)

Did you find this page helpful?