Hello everyone.
I’m encountering an issue while developing a project on Forge using WSL2. When I convert custom fields to Forge UI Kit 2, I start getting this error. Running it with tunnel is very slow, or it throws this error and closes the tunnel.
From the screenshot, I see 2k MB or 2GB as roughly the limit. That said, it’s hard to tell if the limit is a Node.js or WSL problem. In your WSL Linux, could you run free --mega
(and provide the result here) so we can compare to the limit Node is hitting? Also, run node --version
to tell us what version of Node you running? We might need to manually set the memory size in the env var for NODE_OPTIONS
via --max-old-space-size=SIZE
(in megabytes).
I’m running Ubuntu 24.04 (relatively newly available). On my machine I have twice the total & swap memory, and half the used memory at boot. After running forge deploy
(and other commands), my used seems to settle at around 1.4GB, just like yours. Even if you have less memory, I don’t see anything indicating the WSL/Linux configuration is a problem.
I opened a sample app (the Confluence DACI Helper for no other reason than it was handy). After running Forge Tunnel (and leaving it open), my environment reports 2.2GB of memory used, where yours is several times higher. Maybe you could checkout that sample app and compare?
This leads me to recommend upgrading the major version of Node to v18, to match what is running inside Forge. I currently use fnm to manage Node versions, which you can learn about from my blog about developer configuration management. And I currently use a shared bin directory across those versions so I’m not managing multiple versions of the Forge CLI. Newer versions of Node might be even better at managing memory, so you could try v20 or even v22, if v18 doesn’t do enough. Even with newer versions, I’d also recommend the option from my above post.
My overall observation is that you really are running out of memory so you might need to get more, either physically for that machine, or virtually with a developer environment. There are many options these days; my personal experience so far is limited to GitHub Codespaces and AWS Cloud9. Whatever option you choose, you apparently need more RAM available to Node than 8GB.