What happens with Unused Class Properties

2019-08-17 15:54发布

I am interested to know what happens with unused properties of a class when an object is instantiated?

Are there performance hits for having additional unused properties? What about complex properties that are accessing the database, but I'm not using them, are they still being loaded?

1条回答
看我几分像从前
2楼-- · 2019-08-17 16:19

Yes, they are still in memory with default values for the types. Any property sets called will increase memory usage on reference types, whether get is called or not.

查看更多
登录 后发表回答