Today, when go was used for intensive calculation, there was a problem of insufficient memory. After searching, it was said that gc was called manually to reclaim memory and solve the problem.

  golang, question

Today, go is used to do an intensive calculation. here are four strings with lengths of more than 50 bits. then cycle through the four characters to see how many combinations can be formed. the result of the combination is millions. then insert these strings into mysql. then during the cycle, the memory is full. I don’t know how to solve the problem. I searched for a way to use gc manually to release the memory, but I didn’t find out how to use gc to release the memory and find out a demo

The function exits the variable before it is gc? Source code!