5

enter image description here When i use nextjs 13 app directory my ram usage will be around 2 to 3 GB for just running nextjs project currently i am doing 2 project in nextjs app directory but when i switch to pages directory of nextjs from old project and done one project in pages directory it only use maximum of 500MB Nodejs javascript runtime.

I upgrade to lastest nextjs version 13.3.5 and also done update to 18.16.0 but nothing work running in app directory of nextjs. I feel i have done mistake of starting project using app directory as i have done so much i cannot do from strach using pages directory and i have build time of around 1 minutes which reduced my productivity while coding.

Shirshak kandel
  • 328
  • 3
  • 7
  • I am using getServerSideSession for login and admin validation, next auth.js in app directory and API making with app directory ,and framer motion for animation – Shirshak kandel Jun 15 '23 at 07:03
  • 1
    Check out this [issue](https://github.com/vercel/next.js/issues/46756) on github, it is about memory issues with the development server, also if you are using react-icons or MUI that may be the cause. – Fabio Nettis Jun 15 '23 at 13:49
  • Thanks, man I switch from react-icons to react-lucid and use shadcn for the UI component and it reduced memory usage to half but still had 3-4 times higher memory usage and build time compare to the pages directory. – Shirshak kandel Jun 18 '23 at 10:34
  • That is possible, I also have observed a higher memory usage when using app dir compared to pages. But that may be the overhead from using RSC, since server components run on the server e.g use machine resources. – Fabio Nettis Jun 18 '23 at 14:22
  • Yeah, I'm also experiencing this problem. Nextjs keeps consuming memory until I run out of memory or my PC gets frozen or inopperable – Victor Ezekiel Jul 26 '23 at 03:23

0 Answers0