Hi, I found that the theme uses a lot of memories for building site, even I’ve specified the --gc flag.
Once the pages over 10k, the process was killed by OS, since the Out of memory error is reached.
[ 291.214115] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,task=hugo,pid=4795,uid=1000
[ 291.214267] Out of memory: Killed process 4795 (hugo) total-vm:11842260kB, anon-rss:7361308kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:18356kB oom_score_adj:0
[ 291.466886] oom_reaper: reaped process 4795 (hugo), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
I believed there is something need to improve in the theme’s template, how can I determine which part/template using a lot of memories?
@ju52@bep Thanks for your reply, but I’m using hugo for generating the static files in production, the renderToDisk seems not available for hugo command.
$ hugo --gc --renderToDisk
Error: unknown flag: --renderToDisk
I also use --templateMetrics --templateMetricsHints --printMemoryUsage flags for diagnosing the problem, but it’s hard for me to find out the root cause of the problem. Are there extra tools or tricks to troubleshoot this problem?