Change-Id: I982e9012adaf815c8f081b7f9e8ac2267f79de18
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
for (auto &it : channel_handler_release_list)
delete it;
- channel_handler_release_list.clear();
+
+ /* To reduce memory allocation, swap to new data structure.
+ This prevents occasional over-allocation of memory. */
+ std::priority_queue<channel*>().swap(channel_release_queue);
+ std::vector<channel_handler*>().swap(channel_handler_release_list);
}
static gboolean g_io_handler(GIOChannel *ch, GIOCondition condition, gpointer data)