question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LanguageGeneratorExtensions.UseLanguageGeneration GC root / memory leak

See original GitHub issue

Background

There is an issue when using LanguageGeneratorExtensions.UseLanguageGeneration at scale since it uses a static dictionary to store lg managers.

See https://github.com/microsoft/botbuilder-dotnet/blob/f55bbc3f19ca874dceebb59c3ffcb31688f141b4/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/LanguageGeneratorExtensions.cs#L63

and

https://github.com/microsoft/botbuilder-dotnet/blob/f55bbc3f19ca874dceebb59c3ffcb31688f141b4/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/LanguageGeneratorExtensions.cs#L17

This is a GC root so this and any objects in it are never released from memory and over time in a multi tenanted environment this eventually leads to out of memory issues.

We have worked around it by providing our own copy of the behaviour which does not cache. Would it be possible to add an additional parameter to indicate whether or not to cache the lg managers?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
jamesemanncommented, Jan 4, 2021

Apologies for the delay - have tested my use case with solution 1 and it seems to be better. Will update the issue with some supporting data this week

1reaction
jamesemanncommented, Nov 18, 2020

@Danieladu not yet - will update today or tomorrow

Read more comments on GitHub >

github_iconTop Results From Across the Web

memory leak and GC roots - garbage collection
This leaves holes in the space that was not filled up completely and leads to memory fragmentation. The only way to resolve this...
Read more >
Fixing a memory leak - LeakCanary
A memory leak is a programming error that causes an application to keep a reference to an object that is no longer needed....
Read more >
How to get rid of memory leaks? A practical approach using ...
If we are referencing the view from that new GC root, we may create a memory leak if the view gets destroyed before...
Read more >
Hunting Java Memory Leaks
In this post, I'll explain how and why memory leaks occur in Java and outline an approach for detecting such leaks with the...
Read more >
3 Troubleshoot Memory Leaks - Java
One common indication of a memory leak is the java.lang. ... + Allocation Stack Traces + Path to GC Root is selected from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found