Answer the question
In order to leave comments, you need to log in
How to determine the memory size of a dictionary in C#?
There is a dictionary
Dictionary<string, int[,]> tails = new Dictionary<string, int[,]>();
Answer the question
In order to leave comments, you need to log in
1 - https://www.jetbrains.com/dotmemory/ since the studio is not nice to you ..
2 - you can roughly estimate by running through the dictionary, and taking the lengths of the strings (do not forget that this is Unicode) and the sizes of the arrays (again, int == int32 usually), and adding the size of the dictionary (assuming the size of the address, based on the platform)... (in fact, the size of the address array of the dictionary is most likely a multiple of some power of two, or rather a set of blocks, the size of which is powers of two.. but this error, most likely, will not be fundamental, it can be easily insured by throwing a kilobyte)
ps somewhere it will help https ://docs.microsoft.com/en-us/dotnet/csharp/lan... ))
pps https://habr.com/ru/post/136609/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question