Dealing with Memory Issues using Next

Hey all, looking for advice on managing memory. I have a pretty simple Repl, built with Next, that seems to max out memory pretty frequently. https://replit.com/@NoahC2022/Color-ID

Yesterday I got the advice to use ‘rm -rf’ to delete recursive files, then re-install npm. They also mentioned doing the same with Next files.

I tried running rm -rf in command line but can’t tell if it’s running. I’m probably doing something wrong there, but at a larger level, I’m wondering if there’s some trick to keep your next apps from needing this frequent pruning?

it’s not running, you should press the small + button at the top of the panel and type in shell. Then, run those commands. Please keep in mind that doing rm -rf will delete all your files…

1 Like

Thank you! Yeah it’s scary but that was the advice I got in-person from Replit. Would be very open to any other tricks to avoid this, beyond just upgrading the account further, since I worry it’ll still run up.

1 Like

um before doing that maybe um try just deleting node_modules. You can do so by pressing show hidden files and then right clicking on the folder node_modules (that’ll be the most memory consuming folder)

1 Like

Thanks for the tip, looks like it’s a little less than half of the total storage! Issue is that once re-installed, we’re back up to the limit.

I’m going to try to trim up my dependencies. I think they recommended getting rid of the recursive files since those slowly build up and you can reclaim the space until it happens again.

1 Like

yeah I mean afaik replit loves playing with your memory so iirc it auto installs like 50 packages

1 Like

Ohhh maybe that’s it then. I’m going to download the repo and check the sizes. I could only cut a couple dependencies. Do they offer more memory? In deployment plans, they only mention more cpu and ram.

1 Like

they do offer more memory, but there’s no use in just deleting all your files since you can’t use them, I’d try to trim down deps as that’s in my mind the only way to do this, or just switch to another platform since replit isn’t for big projects that need a lot memory. It’s a hobby site more than anything

3 Likes