Next.js Discord

Discord Forum

Large Memory Usage with server actions, use cache, mongoose

Unanswered
Buff-collared Nightjar posted this in #help-forum
Open in Discord
Buff-collared NightjarOP
Hi, I have a CMS project and running multiple sites with it on a VPS linux with 8gb ram on "v15.4.0-canary.116" with turbo repo, since 1 month ago I decided to remove the express backend server and switch to server action with mongoose for data fetching, the project structure is nice cache tags are working as expected except the memory usage, one of the website which I attached the HTOP screenshot from it has almost no traffic and maximum 10 user reach it but the memory usage getting very high, since we don't have any method in NextJs to show use which cache use how much memory I tried manually to find the issue but no luck so far. I share the database connection and 1 of the server actions which get the posts from database, please take a look if I am doing something wrong, even some of the codes are optimized with Claude4 AI but no luck

0 Replies