You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it okay to determine the size of lookup tables using the simple calculation (n * size per element)? Or do I have to include the additional bytes that e.g. a dictionary consumes? If this is the case, how exactly could this be calculated?
If that would be fine, how should I test how much reference types do take from the memory? Since the pointer takes 32 or 64bits depending on which system you are on + the actual memory usage should be (depending on the referenced class) much higher.
Is there any function in c# to figure that out? The sizeof keyword as well as Marshal.SizeOf haven’t worked for me. (The second one would ofc not be allowed in the actual bot since it comes from System.Runtime.InteropServices)
My current lookup tables shouldn't take anything more than 10 Kb, however the diagnostic tools from Visual Studio do say around 150 Mb for the whole program. So my general question would be how to figure out the actual memory size which the program uses specifically for the lookup tables.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is it okay to determine the size of lookup tables using the simple calculation (n * size per element)? Or do I have to include the additional bytes that e.g. a dictionary consumes? If this is the case, how exactly could this be calculated?
If that would be fine, how should I test how much reference types do take from the memory? Since the pointer takes 32 or 64bits depending on which system you are on + the actual memory usage should be (depending on the referenced class) much higher.
Is there any function in c# to figure that out? The sizeof keyword as well as Marshal.SizeOf haven’t worked for me. (The second one would ofc not be allowed in the actual bot since it comes from System.Runtime.InteropServices)
My current lookup tables shouldn't take anything more than 10 Kb, however the diagnostic tools from Visual Studio do say around 150 Mb for the whole program. So my general question would be how to figure out the actual memory size which the program uses specifically for the lookup tables.
Thanks in advance :)
Beta Was this translation helpful? Give feedback.
All reactions