Bug #31932 Avoid calling malloc and free for every event copied by a Binlog Dump thread
Submitted: 30 Oct 2007 1:28 Modified: 15 Jan 2014 9:19
Reporter: Mark Callaghan Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:5.0 OS:Any
Assigned to: Mats Kindahl CPU Architecture:Any
Tags: allocation, Contribution, Memory, replication
Triage: Needs Triage: D5 (Feature request)

[30 Oct 2007 1:28] Mark Callaghan
Binlog Dump threads running on the master call malloc and free for every binlog event copied to a slave. The calls are indirect via the String::append method. This can be made faster by reusing a buffer for reasonably sized events. This will be much more important when row-based replication is deployed.

How to repeat:

Suggested fix:
Allocate a buffer once for each Binlog Dump thread and reuse that buffer when possible. This enhancement is in the MySQL patches at code.google.com
[30 Oct 2007 6:08] Valeriy Kravchuk
Thank you for a reasonable feature request.
[15 Jan 2014 9:18] Jon Stephens
Fixed in 5.7.4 as part of binlog sender optimisation work (which will be documented shortly). That task already references this bug, so closing.