Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Can JObject lead to Memory Leaks in High Usage Envrionment?

$
0
0

I am trying to implement solution in asp.net core 3. I need to make few private properties REDACTED for security purposes while logging into file. As JsonDocument is readonly and I cannot use JsonPath as well, I have shifted to NewtonSoft for this purpose and use JObject.Parse. My concerns are:

  • How much it will affect my performance?

  • Will it lead to memory leaks?

Code:

var requestTokens =JObject.Parse(requestBodyText);// parse request/response foreach(string property inRedactedFields)//for each redacted field in list{JToken token = requestTokens.SelectToken(property);// apply jsonpathif(token !=null){// jsonpath found((Newtonsoft.Json.Linq.JValue)token).Value="******REDACTED******";
        requestTokens.SelectToken(property).Replace(token);}}

Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>