I'm facing problems in my NextJS 14.2.5 and Node 20 application, it turns out that I provision a high number of memory in my container on AWS ECS, but it happens that the application keeps crashing precisely every 1 or 2 hours, from the moment that it is initialized with pm2 start npm -- start the memory usage keeps rising, I tried using npm run start instead of pm2, but the same problem remains.
See the Graphic:

I've already tried using methods that disable the webpack cache, but nothing helped.
Currently I have no idea what could be happening with my application, I have no idea how I can debug and look for the problem to solve. This is mine
Package.json: /* ----------------------------------------- */ { "name": "hidden-name", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { ".io/partytown": "^0.10.2", "/third-parties": "^14.2.5", "he": "^1.2.0", "next": "^14.2.5", "react": "^18", "react-dom": "^18", "react-hook-form": "^7.51.5", "sharp": "^0.33.4", "swiper": "^11.1.9" }, "devDependencies": { "/next": "^9.0.0", "/node": "20.14.2", "/react": "18.3.3", "eslint": "^8", "eslint-config-next": "14.2.5", "postcss": "^8", "tailwindcss": "^3.4.7" } }
This is my Next config:
/* ----------------------------------------- */
/** {import('next').NextConfig} */ const nextConfig = { trailingSlash: true,
experimental: { nextScriptWorkers: true, }, images: { remotePatterns: [ // Hidden ], }, async rewrites() { // Hidden }, async redirects() { // Hidden }, async headers() { // Hidden } };
export default nextConfig;
/* ----------------------------------------- */
I apologize for not providing more details about the code, as it is source code...