You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Dan Hecht (JIRA)" <ji...@apache.org> on 2017/06/27 18:12:00 UTC
[jira] [Created] (IMPALA-5587) ReleaseResources() should not
destroy control structures
Dan Hecht created IMPALA-5587:
---------------------------------
Summary: ReleaseResources() should not destroy control structures
Key: IMPALA-5587
URL: https://issues.apache.org/jira/browse/IMPALA-5587
Project: IMPALA
Issue Type: Sub-task
Reporter: Dan Hecht
For example:
{code:title=RuntimeState::ReleaseResources()}
void RuntimeState::ReleaseResources() {
UnregisterReaderContexts();
if (filter_bank_ != nullptr) filter_bank_->Close();
if (resource_pool_ != nullptr) {
exec_env_->thread_mgr()->UnregisterPool(resource_pool_);
}
block_mgr_.reset(); // Release any block mgr memory, if this is the last reference.
codegen_.reset(); // Release any memory associated with codegen.
// Release the reservation, which should be unused at the point.
if (instance_buffer_reservation_ != nullptr) instance_buffer_reservation_->Close();
// 'query_mem_tracker()' must be valid as long as 'instance_mem_tracker_' is so
// delete 'instance_mem_tracker_' first.
// LogUsage() walks the MemTracker tree top-down when the memory limit is exceeded, so
// break the link between 'instance_mem_tracker_' and its parent before
// 'instance_mem_tracker_' and its children are destroyed.
instance_mem_tracker_->UnregisterFromParent(); <=======
if (instance_mem_tracker_->consumption() != 0) {
LOG(WARNING) << "Query " << query_id() << " may have leaked memory." << endl
<< instance_mem_tracker_->LogUsage();
}
instance_mem_tracker_.reset(); <=======
if (local_query_state_.get() != nullptr) {
// if we created this QueryState, we must call ReleaseResources()
local_query_state_->ReleaseResources();
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)