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

Investigate event listeners when zooming in/out with settings json editor open #1062

Closed
3 tasks done
kittaakos opened this issue Jun 14, 2022 · 0 comments · Fixed by #1255
Closed
3 tasks done

Investigate event listeners when zooming in/out with settings json editor open #1062

kittaakos opened this issue Jun 14, 2022 · 0 comments · Fixed by #1255
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

Describe the problem

I am seeing warnings related to the increasing number of event listeners. I could reproduce it with RC7.

To reproduce

  • Open Settings JSON,
  • Zoom in/out ~200 times
init (editor-manager.ts:61)
_postConstruct (instantiation.ts:40)
resolveInstance (instantiation.ts:68)
(anonymous) (resolver.ts:102)
_injectProperties (instantiation.ts:19)
resolveInstance (instantiation.ts:63)
(anonymous) (resolver.ts:102)
resolve (resolver.ts:140)
(anonymous) (container.ts:382)
__webpack_modules__.../node_modules/inversify/lib/container/container.js.Container._get (container.ts:354)
__webpack_modules__.../node_modules/inversify/lib/container/container.js.Container.get (container.ts:246)
(anonymous) (preference-transaction-manager.ts:279)
doSetPreference (abstract-resource-preference-provider.ts:118)
setPreference (abstract-resource-preference-provider.ts:112)
setWithConfigName (user-configs-preference-provider.ts:101)
setPreference (user-configs-preference-provider.ts:109)
set (preference-service.ts:420)
savePreference (settings.ts:249)
save (settings.ts:281)
await in save (async)
execute (edit-contributions.ts:65)
await in execute (async)
executeCommand (command.ts:336)
await in executeCommand (async)
executeKeyBinding (keybinding.ts:478)
run (keybinding.ts:568)
(anonymous) (frontend-application.ts:239)
root WARN Possible Emitter memory leak detected. 264 listeners added. Use event.maxListeners to increase the limit (175). MOST frequent listener (89):
e.log @ logger-protocol.ts:110
(anonymous) @ logger-frontend-module.ts:41
(anonymous) @ logger.ts:312
(anonymous) @ logger.ts:304
Promise.then (async)
log @ logger.ts:299
i @ logger.ts:45
checkMaxListeners @ event.ts:248
_event._event.Object.assign.maxListeners @ event.ts:190
init @ editor-manager.ts:61
(anonymous) @ instantiation.ts:40
t.resolveInstance @ instantiation.ts:68
(anonymous) @ resolver.ts:102
t.length.a @ instantiation.ts:19
t.resolveInstance @ instantiation.ts:63
(anonymous) @ resolver.ts:102
t.resolve @ resolver.ts:140
(anonymous) @ container.ts:382
e._get @ container.ts:354
e.get @ container.ts:246
(anonymous) @ preference-transaction-manager.ts:279
doSetPreference @ abstract-resource-preference-provider.ts:118
setPreference @ abstract-resource-preference-provider.ts:112
s @ user-configs-preference-provider.ts:101
setPreference @ user-configs-preference-provider.ts:109
set @ preference-service.ts:420
savePreference @ settings.ts:249
save @ settings.ts:287
async function (async)
save @ settings.ts:254
execute @ edit-contributions.ts:77
async function (async)
execute @ edit-contributions.ts:70
executeCommand @ command.ts:336
async function (async)
executeCommand @ command.ts:335
executeKeyBinding @ keybinding.ts:478
run @ keybinding.ts:568
(anonymous) @ frontend-application.ts:239
logger-protocol.ts:110 root WARN     at b._event._event.Object.assign.maxListeners [as onDidChangeCurrentWidget] (file:///Applications/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2310677)
    at s.init (file:///Applications/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2747135)
    at file:///Applications/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:8415749
    at Object.t.resolveInstance (file:///Applications/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:8415821)
    at file:///Applications/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:8417509
    at Array.map (<anonymous>)
    at t.length.a (file:///Applications/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:8415476)
    at Object.t.resolveInstance (file:///Applications/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:8415568)

Expected behavior

Event listeners do not leak.

Arduino IDE version

rc7

Operating system

macOS

Operating system version

12.3.1

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jun 14, 2022
@kittaakos kittaakos self-assigned this Jun 14, 2022
kittaakos pushed a commit that referenced this issue Jul 25, 2022
Do not create a new instance per preferences transaction.

Closes #1062

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Jul 26, 2022
Do not create a new instance per preferences transaction.

Closes #1062

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Jul 27, 2022
preferences transaction.

Closes #1062

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Jul 27, 2022
preferences transaction.

Closes #1062

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Jul 27, 2022
 - Debounced the connectivity status update.
 - Silent the output channel for the Arduino LS.
 - Delay the problem markers update with 500ms.
 - Do not update the status bar on every `keypress` event.
 - Debounced the tab-bar toolbar updates when typing in editor.
 - Fixed electron menu contribution binding.
 - Aligned the editor widget factory's API to Theia.
 - Set the zoom level when the app is ready (Closes #1244)
 - Fixed event listener leak (Closes #1062)

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Jul 27, 2022
 - Debounced the connectivity status update.
 - Silent the output channel for the Arduino LS.
 - Delay the problem markers update with 500ms.
 - Do not update the status bar on every `keypress` event.
 - Debounced the tab-bar toolbar updates when typing in editor.
 - Fixed electron menu contribution binding.
 - Aligned the editor widget factory's API to Theia.
 - Set the zoom level when the app is ready (Closes #1244)
 - Fixed event listener leak (Closes #1062)

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Jul 28, 2022
 - Debounced the connectivity status update.
 - Silent the output channel for the Arduino LS.
 - Delay the problem markers update with 500ms.
 - Do not update the status bar on every `keypress` event.
 - Debounced the tab-bar toolbar updates when typing in editor.
 - Fixed electron menu contribution binding.
 - Aligned the editor widget factory's API to Theia.
 - Set the zoom level when the app is ready (Closes #1244)
 - Fixed event listener leak (Closes #1062)

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Aug 1, 2022
 - Debounced the connectivity status update.
 - Silent the output channel for the Arduino LS.
 - Delay the problem markers update with 500ms.
 - Do not update the status bar on every `keypress` event.
 - Debounced the tab-bar toolbar updates when typing in editor.
 - Fixed electron menu contribution binding.
 - Aligned the editor widget factory's API to Theia.
 - Set the zoom level when the app is ready (Closes #1244)
 - Fixed event listener leak (Closes #1062)

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants