Memory leaks detected
See original GitHub issueWe have implemented the ApplicationInsights package and it works like we expect, however my gulp test-all is coming back with a memory leak:
The following leaks were detected:diagnosticsSource, __zone_symbol__Promise, __zone_symbol__Error, Zone, __zone_symbol__setTimeout, __zone_symbol__clearTimeout, __zone_symbol__setInterval, __zone_symbol__clearInterval, __zone_symbol__setImmediate, __zone_symbol__clearImmediate
Any ideas what could be the problem or how to get around this? Example implementation below:
`const applicationInsights = require(‘applicationinsights’)
applicationInsights.setup(env.APPINSIGHTS_INSTRUMENTATIONKEY) applicationInsights.defaultClient.context.tags[env.APPINSIGHTS_KEY] = env.APPINSIGHTS_ROLENAME applicationInsights.start()
const client = applicationInsights.defaultClient
function appInsightsLogger (message, exception) { if (exception != null) { client.trackException({exception: new Error(message)}) } client.trackEvent({name: ‘My Custom Event’, properties: {customProperty: message}}) } `
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
Many thanks, that’s done it for me.
@simpliciti-238 Just updating this thread to mention that this issue may have been fixed by https://github.com/Microsoft/ApplicationInsights-node.js/pull/478, so a workaround might not be necessary anymore.