Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak occurred when a for loop was add to the "HelloDirectML" Demo #85

Open
laoniangjiu opened this issue Mar 18, 2021 · 2 comments

Comments

@laoniangjiu
Copy link

laoniangjiu commented Mar 18, 2021

Hi,
When I add a for loop to the HelloDirectML demo to run the operator continuously,I found the memory usage continue to grow at the same time, seems like a memory leak.

main.zip

for (int i = 0; i != 1000; ++i) {
        commandList->SetDescriptorHeaps(ARRAYSIZE(d3D12DescriptorHeaps), d3D12DescriptorHeaps);

        dmlCommandRecorder->RecordDispatch(commandList.get(), dmlCompiledOperator.get(), dmlBindingTable.get());

        CloseExecuteResetWait(d3D12Device, commandQueue, commandAllocator, commandList);

        std::this_thread::sleep_for(std::chrono::milliseconds(30));
}
@jstoecker
Copy link
Contributor

Thanks for reporting this. It's likely that the D3D command allocator is never reset in this sample, so it will grow unbounded. We'll fix it soon. :)

@jstoecker
Copy link
Contributor

Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants