Episerver Product Issue - DefaultContentLanguageSettingsHandler.Get method

Fixed in

EPiServer.CMS.Core 11.18.0

Created

Apr 29, 2020

Updated

Aug 11, 2020

Area

CMS Core

State

Closed, Fixed and tested


Description

I have a product issue to report that exists in the DefaultContentLanguageSettingsHandler.Get method. This is being identified using the Briscoe client.

This is the same type of Func<,> allocation issue as described in my previous issue, but for a different method. Also, 1GB of memory.

I’ve circled the lambda that’s causing the Func allocation.

So, in this case it’s better to break apart the Get and Add and eliminate the Func usage entirely.

private IEnumerable<ContentLanguageSetting> Get(ContentReference contentLink, HashSet<ContentReference> visitedContents)

{

if (ContentReference.IsNullOrEmpty(contentLink)) return null;

ValidateCircularReference(contentLink, visitedContents);

var contentReference = contentLink.ToReferenceWithoutVersion();

IEnumerable<ContentLanguageSetting> languageSettings;

if (!_treeMap.TryGetValue(contentReference, out languageSettings))

{ languageSettings = GetSetting(contentReference, visitedContents); _treeMap.TryAdd(contentReference, languageSettings); }

return languageSettings;

}

The above code is the fix.

* Please see Zendesk Support tab for further comments and attachments.

Note for QA: To verify this we should make sure LanguageSettings (fallback/replacement) still work work as previously.