Amresh S

Amresh S

  • NA
  • 437
  • 17.1k

Memory allocation for dynamic parameters

Feb 16 2017 5:18 AM
Hi All,
 
I'm having a doubt, whether the dynamic parameters are allocated memory and cleaned by grabage collector? Please refer the below code snippet:
 
  1. string a = myFunction(nullnew myType());  
Here, "new myTyep()" is the dynamically created parameter. Will it be ok to do so. It is fine for me to send "null" also. But, my question is, will it cause any unwanted memory usage of hidden symbols refered or it will be mamaged by the garbage collector?
 
Thanks in Advance.
 
Regards,
Amresh S. 
 
 

Answers (1)