You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a memory issue in my Next.js project, and the cause was the gcTime configuration.
When I removed the existing 24-hour gcTime setting or changed it to 0, the memory leak was resolved, but I don't understand why.
From what I know, gcTime is set to Infinity by default in Next.js server environments, so it seems like memory wouldn't be released and should cause problems, but that wasn't the case. What could be the issue here?
For testing, I repeatedly sent curl requests to the suspected page and confirmed JS OOM errors. After removing code piece by piece to track down the cause, I was able to resolve the issue by changing the gcTime setting value.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I encountered a memory issue in my Next.js project, and the cause was the gcTime configuration.
When I removed the existing 24-hour gcTime setting or changed it to 0, the memory leak was resolved, but I don't understand why.
From what I know, gcTime is set to Infinity by default in Next.js server environments, so it seems like memory wouldn't be released and should cause problems, but that wasn't the case. What could be the issue here?
For testing, I repeatedly sent curl requests to the suspected page and confirmed JS OOM errors. After removing code piece by piece to track down the cause, I was able to resolve the issue by changing the gcTime setting value.
Beta Was this translation helpful? Give feedback.
All reactions