Skip to content

Commit 333f2df

Browse files
authored
server: Drop contents of exec_info body on clear (#5740)
server: Drop contents of exec_info body on clear Previously when clearing the exec info state we held the capacity of the body vector. In a couple of cases this vector has been seen to be large enough to cause very high memory usage where each context object holds around 1MiB of memory and adds up to multiple GiBs. The vector is now cleared and the capacity is also dropped to 0. Signed-off-by: Abhijat Malviya <[email protected]>
1 parent a738db4 commit 333f2df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server/conn_context.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ vector<unsigned> ConnectionContext::ChangeSubscriptions(CmdArgList channels, boo
307307
void ConnectionState::ExecInfo::Clear() {
308308
DCHECK(!preborrowed_interpreter); // Must have been released properly
309309
state = EXEC_INACTIVE;
310-
body.clear();
310+
vector<StoredCmd>{}.swap(body);
311311
is_write = false;
312312
ClearWatched();
313313
}

0 commit comments

Comments
 (0)