-
Marc Alff authored
Before this fix, when sending a massive load spike to a freshly started server, the server would allocate a huge amount of memory, possibly leading to Out Of Memory failures. The root cause is how concurrent request to grow a scalable buffer are handled, for the performance schema. Before the fix, N threads could run in parallel each allocating memory, with later N-1 threads freeing the memory allocated when a collision is detected after the fact. With the fix, N threads attempting to expand a buffer in parralel will block and wait, with only one thread performing the allocation, so that collisions are prevented. See comments added in PFS_buffer_scalable_container::allocate() for details.
Marc Alff authoredBefore this fix, when sending a massive load spike to a freshly started server, the server would allocate a huge amount of memory, possibly leading to Out Of Memory failures. The root cause is how concurrent request to grow a scalable buffer are handled, for the performance schema. Before the fix, N threads could run in parallel each allocating memory, with later N-1 threads freeing the memory allocated when a collision is detected after the fact. With the fix, N threads attempting to expand a buffer in parralel will block and wait, with only one thread performing the allocation, so that collisions are prevented. See comments added in PFS_buffer_scalable_container::allocate() for details.
Loading