[SERVER-26614] Do not round up buffer sizes when receiving Messages Created: 13/Oct/16  Updated: 19/Nov/16  Resolved: 13/Oct/16

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: 3.4.0-rc1

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: platforms-hocr
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platforms 2016-10-31
Participants:

 Description   

The MessagePort::recv class rounds up the size of the buffer it uses to hold a message coming off the network.

There is no good reason to do so, and some reasons to actively not do so, since:

  • TCMalloc already groups allocations into size buckets
  • The extra allocation wastes 0.5kb on average for each server operation in progress
  • ASAN and other tools will see the extra bytes as valid to access, even though they contain garbage data, potentially masking bugs.

We should remove the rounding.



 Comments   
Comment by Githook User [ 13/Oct/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-26614 Clean up memory management in MessagePort::recv
Branch: master
https://github.com/mongodb/mongo/commit/91a22832b42c814909feeb6dc18f9f098fdd7313

Generated at Thu Feb 08 04:12:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.