-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix a lot of memory leaks #15
base: master
Are you sure you want to change the base?
Conversation
1 similar comment
@@ -21,17 +21,11 @@ type BaseObject struct { | |||
o *C.PyObject | |||
} | |||
|
|||
var baseObjMap = make(map[*C.PyObject]*BaseObject) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why are you removing this? and similar ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it causes memory leaks. there is no code which in charge to remove an item from the map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But doesn't this enable us to reuse an object created before and not create it again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its broken by design, i mean the way to save few bytes and couple milliseconds :) and caused a lot of memory leaks with random data. There are two ways to fix it:
- remove the reason (pull request)
- implement some kind of TTL (time to live) for every single item stored this way
its your repo, your choice :)
Anyway, i've forked this repo and using it without leaks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so I will check if there is any problem with other repositories while using these changes. Thanks
I have checked this. Although the tests are passing but with https://github.com/limetext/sublime, It's causing panic:
|
Reopenning this because the error mentioned is not related to this pr. We should test this after resolving #16. |
1 similar comment
This should get applied after resolving #12 (comment). |
No description provided.