How to Memory Profile in Hugo Server

Is there anyway to profile memory usage and consumption for hugo server? I need to trace what exactly occupying the memory space and does not allow Go’s garbage collection to collect back.


Issue trying to solve:

Worst case impact: Hugo memory consumption keeps growing to 100% and even entering swap partition.


Current workaround: periodically kill and start the server via cmd script (server.cmd)


Attempted: tried all the commands in here but hugo does not generate the mystats.txt output.