I have a repository with a (unhealthy) large amount of modules that are hosted on Github (not sure if that is important, but I feel like it is). Starting hugo server
takes a long time, long as in 6 to 12 minutes. I thought running with --printMemoryUsage
might shed some light if something is going on. It displays blocks like the following at the beginning of running the command:
Alloc = 151.2 MB
TotalAlloc = 262.9 MB
Sys = 229.6 MB
NumGC = 14
In the end, it grew to
Alloc = 319.1 MB
TotalAlloc = 55.9 GB
Sys = 886.1 MB
NumGC = 351
I am pretty sure that all modules and the website repo itself do not sum up to 55GB in file size. What exactly is the TotalAlloc about? Also, the others, what might they be about? Is this a normal behaviour? The site has 108 posts, so it’s not some large dataheavy website.
I did “vendor” the modules with a little time win, but then startup stayed long. I remember, a while back, when Hugo was in it’s 80s, I did move all modules into my theme (layout directory), and the startup time improved down to about 1.5 minutes. Did not do that now yet. But I somehow think I will.
Is there anything that looks weird on this? I got used to the delay because, in the optimum case the server, once up and running, stays up, but it seems to me that this is not normal behaviour due to the large amount of modules used.
Once running the allocation goes down to this:
Alloc = 183.9 MB
TotalAlloc = 1.9 GB
Sys = 421.3 MB
NumGC = 28
My repo is at GitHub - davidsneighbour/kollitsch.dev: Content and website setup for kollitsch.dev.