What happens in memory when there is a class with 50 methods and we create 50 object instances of that class? What is the best solution for having an object
with a lot of functionality and less memory usage?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Yes, C#/.Net methods require memory on per-AppDomain basis, there is no per-instance cost of the methods/properties.
Cost comes from:
So instantiating 1 or 50 objects with 50 methods will not require different amount of memory for methods.
Firstly the memory usage and functionality is not based on the object, its based on the class of which we are making an object... hence if you are making a object of a class you are able to access all the functionality of that class.. and according to me its a better option to use a object for accessing a class functionality