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 Leaks in creating Tensors and Ops #13

Open
karanchahal opened this issue Mar 15, 2019 · 1 comment
Open

Memory Leaks in creating Tensors and Ops #13

karanchahal opened this issue Mar 15, 2019 · 1 comment
Assignees

Comments

@karanchahal
Copy link
Owner

karanchahal commented Mar 15, 2019

Lot of times we are constructing objects on the heap and not explicitly deleting them. This leads to a ton of memory leaks. We need to debug this and solve it. One way is to manually keep a check of these pointers. Another way is to use smart pointers and let memory leaks be handled that way.

@karanchahal
Copy link
Owner Author

We have two options to handle memory leaks:

  1. We remove all dependencies, all tensors and operations by using a DFS like call when the destructor of a Tensor is called.
  2. Or we use smart pointers and let C++ handle memory safety.

As pointers are shared cyclically, we will need to use a combination of shared and weak pointers.

Any thoughts on how to handle memory leaks @uditarora ?

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