Skip to content
Snippets Groups Projects
Commit d4268649 authored by Yang Gao's avatar Yang Gao
Browse files

Merge pull request #2279 from vjpai/openleaks

qps_test memory leak elimination: delete spare contexts lying around at the end of test
parents 775eaec7 13735d5d
No related branches found
No related tags found
No related merge requests found
...@@ -199,6 +199,15 @@ class AsyncClient : public Client { ...@@ -199,6 +199,15 @@ class AsyncClient : public Client {
delete ClientRpcContext::detag(got_tag); delete ClientRpcContext::detag(got_tag);
} }
} }
// Now clear out all the pre-allocated idle contexts
for (int ch = 0; ch < channel_count_; ch++) {
while (!contexts_[ch].empty()) {
// Get an idle context from the front of the list
auto* ctx = *(contexts_[ch].begin());
contexts_[ch].pop_front();
delete ctx;
}
}
} }
bool ThreadFunc(Histogram* histogram, bool ThreadFunc(Histogram* histogram,
......
...@@ -60,7 +60,7 @@ static void RunQPS() { ...@@ -60,7 +60,7 @@ static void RunQPS() {
client_config.set_rpc_type(UNARY); client_config.set_rpc_type(UNARY);
client_config.set_load_type(POISSON); client_config.set_load_type(POISSON);
client_config.mutable_load_params()-> client_config.mutable_load_params()->
mutable_poisson()->set_offered_load(10000.0); mutable_poisson()->set_offered_load(1000.0);
ServerConfig server_config; ServerConfig server_config;
server_config.set_server_type(ASYNC_SERVER); server_config.set_server_type(ASYNC_SERVER);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment