Out of memory with hugo 0.55

I just noticed that my site now returns an out of memory error when I try to build it on the webserver’s side.

The log is available here:

The server is running on Digital Ocean with 2GB of Memory

I am guessing the solution will probably be a server upgrade :man_shrugging:

I have perhaps the same problem. I used 0.54 with no trouble in a virtual machine allocated 3GB of memory, with Firefox and some other GUI applications running. I never had problems with that.

0.55.0 didn’t work with my site (“invalid taxonomy state” panic), but the 0.55.2 bugfix release does work. However, with 0.55.2, I could barely build the site with 3GB of memory allocated to the VM. Sometimes it would fail with a similar out of memory panic as what you’re experiencing. When it worked, it might take 5 minutes to build.

I increased memory allocation to 6GB, and now 0.55.2 works, but it’s still slow. And that’s more memory than I want to give to this VM.

Anyone else finding 0.55.x to be very memory hungry?

I have tests showing a more than 10% reduction in memory allocation and usage for general Hugo test building, but this of course depends on “what you use”. I may have introduced “something” in that release – which was not intended. I could have a look at it, but then I need to see a “prolbme site source”.

The benchmark above compares 0.54 with 0.55 for a fairly common Hugo site with 5000 pages, shortcodes, tags etc. on my MacBook.

Our build on a gitlab shared runner fails sometimes with an out of memory fatal error/panic.

I will track this issue in https://github.com/gohugoio/hugo/issues/5890

I have a suspect, but I will investigate. Thanks for the reports and the repo.

1 Like

I’m pretty sure that the out of memory errors on your site should be fixed in Hugo 0.55.4 (just out). And on my MacBook it also builds about twice as fast …

@brunoamaral I have not checked your site, but if it’s a multilingual site, the reason is probably the same.

1 Like

Yes indeed! You’re awesome!

I’m happy to have the Table of Contents listing all headers now, thanks to your shortcode handling improvement. Thanks so much for all your work on this valuable tool!


I have also checked and everything is working fine. Thank you @bep !