summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2016-01-11 17:48:46 -0500
committerAdam Midvidy <amidvidy@gmail.com>2016-01-15 15:35:34 -0500
commit48a29450239d88607842cb7f2eb7d34d89bbcb1f (patch)
tree28f245a5567dfcadc256ae7a202099ae63edc001
parentd1f62c6fbcc0833e3889fa1baa71e30525461c6b (diff)
downloadmongo-48a29450239d88607842cb7f2eb7d34d89bbcb1f.tar.gz
SERVER-22100 do not preallocate find/getMore response buffers on Windows DEBUG
(cherry picked from commit 9cce8846424654653e9449c134fadbe56a7c5df1)
-rw-r--r--src/mongo/db/dbcommands.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index f73b0a186dd..2edf13c149e 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -1341,7 +1341,17 @@ void Command::execCommand(OperationContext* txn,
bool Command::run(OperationContext* txn,
const rpc::RequestInterface& request,
rpc::ReplyBuilderInterface* replyBuilder) {
- BSONObjBuilder inPlaceReplyBob(replyBuilder->getInPlaceReplyBuilder(reserveBytesForReply()));
+ auto bytesToReserve = reserveBytesForReply();
+
+// SERVER-22100: In Windows DEBUG builds, the CRT heap debugging overhead, in conjunction with the
+// additional memory pressure introduced by reply buffer pre-allocation, causes the concurrency
+// suite to run extremely slowly. As a workaround we do not pre-allocate in Windows DEBUG builds.
+#ifdef _WIN32
+ if (kDebugBuild)
+ bytesToReserve = 0;
+#endif
+
+ BSONObjBuilder inPlaceReplyBob(replyBuilder->getInPlaceReplyBuilder(bytesToReserve));
repl::ReplicationCoordinator* replCoord = repl::getGlobalReplicationCoordinator();