Next.js Discord

Discord Forum

How to use build `trace` file?

Unanswered
Gharial posted this in #help-forum
Open in Discord
GharialOP
Hi team

Recently our company project encounters OOM issue, So we want to figure out which file caused it, I found nextjs will generate a trace file when building the app, but I don't know to use it to debug?

Anyone can guide me how to do it? Thanks!👀

9 Replies

GharialOP
Thanks

I already generated the file, but it's a huge json file

I also tried using visualize tool, but it didn't work due to large file limit.
Plott Hound
I’ll do some testing and see if there’s an easy way to list the ram usage by file but I’m not sure if you can. Did you try a bundle analyser?
Also worth noting the most recent versions of next seem to be taking up more ram
GharialOP
Bundle Analyser can not list the OOM file, I tried

and I will try to use the latest Nextjs to build again

Thank you!
GharialOP
Unfortunately, 8 GB ram is still not enough for latest version of Nextjs.
under the context of our codebase.
Plott Hound
Wow that’s a lot. Just to clarify are you getting OOM during build causing it to fail? Or is the error in prod/dev?
GharialOP
yes, the OOM happens in build time.



yarn dev works well