Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: ioutil.ReadFile when reading big files may cause long STW pauses #39479
What version of Go are you using (
I don't think this is what is happening. If you wait for the goroutine doing ReadFile to finish (before the main function exits), it will take a lot longer. From your trace it seems it took ~40 ms to preempt that goroutine and stop the world, but it didn't wait the whole ReadFile to finish.
(~40 ms is still kind of long. I guess it is probably allocating and zeroing the memory of the big slice, which is currently nonpreemptible (#36365))