Unverified Commit ceb25724 authored by Hongzhi (Steve), Chen's avatar Hongzhi (Steve), Chen Committed by GitHub
Browse files

[Misc] re-enable destructor method of WorkspacePool. (#6173)


Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
parent 7ed2991f
...@@ -125,21 +125,19 @@ WorkspacePool::WorkspacePool( ...@@ -125,21 +125,19 @@ WorkspacePool::WorkspacePool(
WorkspacePool::~WorkspacePool() { WorkspacePool::~WorkspacePool() {
/** /**
* Comment out the destruct of WorkspacePool, due to Segmentation fault with * Note that the following code will cause Segmentation fault with MXNet.
* MXNet Since this will be only called at the termination of process, not * Since we're phasing out MXNet, it's acceptable to keep it as it is.
* manually wiping out should not cause problems. * Commenting out the following code will cause memory leak.
* Note, this will cause memory leak without the following code, so, maybe
* we need to solve the problem.
*/ */
// for (size_t i = 0; i < array_.size(); ++i) { for (size_t i = 0; i < array_.size(); ++i) {
// if (array_[i] != nullptr) { if (array_[i] != nullptr) {
// DGLContext ctx; DGLContext ctx;
// ctx.device_type = device_type_; ctx.device_type = device_type_;
// ctx.device_id = static_cast<int>(i); ctx.device_id = static_cast<int>(i);
// array_[i]->Release(ctx, device_.get()); array_[i]->Release(ctx, device_.get());
// delete array_[i]; delete array_[i];
// } }
// } }
} }
void* WorkspacePool::AllocWorkspace(DGLContext ctx, size_t size) { void* WorkspacePool::AllocWorkspace(DGLContext ctx, size_t size) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment