You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You probably already know this, but in the case that you don't. This program is full of memory leaks. I've looked through this code. Everytime you do a heap allocation you don't delete it anywhere. If you do a simple while loop:
whileTrue:
print("Hello, World!")
This will eventually crash, because inside the visit nodes you return new PyNone() and never clean them up. Inside the while loop visit you evaluate the condition, but never delete the condition object.
The text was updated successfully, but these errors were encountered:
I’ve just seen the data leak issue you reported two months ago, and I want to prioritize fixing it in the next release. While I’ve been preparing some new features, I recognize that this memory leak is more critical and will focus on resolving it first. I’ve been working alone on the project recently, so I apologize for the delay. Do you have any suggestions on how to approach this problem directly?
Fixing this would be really hard and time consuming, because these allocations happen everywhere throughout the project.
I would recommend using shared_ptr and/or unique_ptr. It's basically a wrapper around a raw pointer, but it will clean itself up when no references exist to itself anymore. Use unique_ptr wherever you can because it's faster than shared_ptr.
If you don't want to use smart pointers, you could probably delete the memory from the destructors.
You probably already know this, but in the case that you don't. This program is full of memory leaks. I've looked through this code. Everytime you do a heap allocation you don't delete it anywhere. If you do a simple while loop:
This will eventually crash, because inside the visit nodes you return
new PyNone()
and never clean them up. Inside the while loop visit you evaluate the condition, but never delete the condition object.The text was updated successfully, but these errors were encountered: