Is memory used by an object's declared, but undefined member?
If my class has declared a
private var _iDontGetDefined:EnormousObject;
but never creates anything to be stored 开发者_JAVA技巧there, does this impact performance or use a significant amount of memory?
Such declaration will not affect performance and will have almost no impact on memory footprint.
If you want to maintain a lot of similar and optional values, you may consider using a Dictionary.
精彩评论