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

fix a lot of memory leaks #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

halturin
Copy link

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 22.23% when pulling 6cbe5a9 on halturin:master into bd3afdc on limetext:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 22.23% when pulling 6cbe5a9 on halturin:master into bd3afdc on limetext:master.

@@ -21,17 +21,11 @@ type BaseObject struct {
o *C.PyObject
}

var baseObjMap = make(map[*C.PyObject]*BaseObject)
Copy link
Member

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.

Copy link
Author

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

Copy link
Member

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?

Copy link
Author

@halturin halturin Dec 12, 2017

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:

  1. remove the reason (pull request)
  2. 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

Copy link
Member

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

@zoli
Copy link
Member

zoli commented Dec 18, 2017

I have checked this. Although the tests are passing but with https://github.com/limetext/sublime, It's causing panic:

unexpected fault address 0x7f40647ddba8
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x2 addr=0x7f40647ddba8 pc=0x7d4719]

@zoli zoli closed this Dec 18, 2017
@zoli
Copy link
Member

zoli commented Jan 2, 2018

Reopenning this because the error mentioned is not related to this pr. We should test this after resolving #16.

@zoli zoli reopened this Jan 2, 2018
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 22.278% when pulling 6cbe5a9 on halturin:master into bd3afdc on limetext:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 22.278% when pulling 6cbe5a9 on halturin:master into bd3afdc on limetext:master.

@zoli
Copy link
Member

zoli commented Jul 6, 2019

This should get applied after resolving #12 (comment).

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

Successfully merging this pull request may close these issues.

3 participants