-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 leak when creating and destroying multiple editors #344
Comments
100K is so miniscule on today's hardware and, given the complexity of in-browser editors, I find it rather unbelievable that a user is going to create and destroy anywhere close to 20,000 editor instances in a single tab (20,000 is ~2GB RAM). I'm used to restarting my browser anyway every so often because Firefox loves to chug RAM and not free it. This could be just as much a web browser issue as an ACE issue. |
I have spent time working on cleaning up many of the leaks and I've made substantial progress (at least on the version of ACE that i'm using). This is definitely an issue in ACE and not a browser issue. Although I can relate to your feedback about how little 100K is in this day and age, we want ACE to be a production grade application and the simple truth is that production grade applications shouldn't leak. The sooner we address these leaks the easier it will be to maintain that state going forward. Julian and Fabian have already begun addressing them by adding some partial destroy methods in the code. I think it's simply a matter of continuing that work. Thanks, |
Could you share the change you did to fix the leaking? |
BTW usually you don't have to create and destroy editors. If you want to use multiple documents simply switch the edit session. However this doesn't invalidate you point of fixing memory leaks. |
see also #254 |
I have found ways to address a number of the objects leaking, but I'm working on a much older version of ACE from about 4 months ago. Also, I was having trouble getting the core objects to clean up, editor, virtual_render, layer/text, and document were the stickiest ones that I could not get to fully release. One issue seemed to be how pilot attached events. It seems more useful if all of the addEventListener functions would return a function that could be called that would release all of those connections. Although I agree that one way to implement tabbed editors would be to swap out the sessions it seems like a very desirable ability to have the sessions be completely isolated, so that the code can not even know that there are multiple tab's in play. In the app i'm working on we are using dojo for all tab management and ACE has been wrapped in a dojo widget (seems like this might be something that would be nice to be added to your distro). If I were to be switching out ACE sessions I would need knowledge of ACE to creep several layers higher then it currently is. This would be undesirable. Thanks, |
Looks like main issue was resize event listener added by ace.edit. see 37d41ab |
|
Did this ever get fixed? I'm seeing a memory leaks as well, and it seems to happen when I'm creating/destroying a lot of Ace editors. |
@geraintluff do you have a demo showing the problem? |
I've taken the demo editor.html page and set it to dynamically create and destroy editors in a loop each second. This seems to leak about 100k each editor and eventually will crash the tab.
@Gissues:{"order":62.1118012422362,"status":"backlog"}
The text was updated successfully, but these errors were encountered: