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 freeing #87

Open
pawelkulig1 opened this issue Apr 24, 2018 · 6 comments
Open

Memory freeing #87

pawelkulig1 opened this issue Apr 24, 2018 · 6 comments
Assignees

Comments

@pawelkulig1
Copy link
Collaborator

I think you haven't checked if function removeDataObject is working. Python has garbage collector that deletes object when there is 0 refs, but another thing is that Python releases this memory when it wants not when we want that. Using del operator for example is considered bad practice. If we truly want to delete some object from mem, we should restart program or, delete all references to object and wait until it's deleted (It may never happen). I don't think there is proper solution for that because Python seems to be smarter. Fortunately it seems that garbage collector is doing good job at runtime end.

@LemurPwned
Copy link
Owner

LemurPwned commented Apr 24, 2018

Del operator only works if a reference goes out of scope. Reference to an doh objext does not go out of scope until it main window still has doh reference.
The only reason for removing function (not object removal) in doh is that the object held in doh should be nullified as soon as it is not used -but still, references to doh should be held. We dont want to destroy doh objects but some of its contents . Obviously overwriting del operator is a bad idea in that case unless we would be in control of object deletion across its references.
That is why doh was created to manage references and drop them easily for data structs that are no longer required. Another reason for that is that we dont want to risk the access of invalid data (the data that is still held in doh but is already outdated)
About removing object it is true, it happens that I did not return inner funciton that is why it didnt work

Virtually same topic as #56

@pawelkulig1
Copy link
Collaborator Author

You are right but I doesn't change anything even if you set all this variables to None, memory is not released. Check it with memory profiler.

@LemurPwned
Copy link
Owner

Right, it doesnt now if the widgets are still running, we are just removing reference from doh which would be still there after widget is destroyed.

@pawelkulig1
Copy link
Collaborator Author

Closer but still not there :P

@pawelkulig1
Copy link
Collaborator Author

Of course problem is connected with deleting only reference

@LemurPwned
Copy link
Owner

What do you mean? I think I dont get it. What I meant is that we merely nullify reference in doh objects not outside. If reference exists outside then it should, but since doh is sort of global it must be cleaned manually, but that doest equal data deletion

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

No branches or pull requests

2 participants