G
Guest
Hi All
Here i am facing one technical issue related to Swapping the Object Instance
in Dotnet.
e.g..
class Customer{
Order _lastOrder;
void insertOrder (int ID, int quantity, double amount, int productId)
Order currentOrder = new Order(ID, quantity, amount, productID);
currentOrder.Insert();
this._lastOrder = currentOrder
}
this is my class, when i try to swap the currentOrder instance to
_lastOrder, what could happen for the currentOrder object memory, whether it
will destroy immediately or what is the stage. As per the Microsoft
suggestion avoid this type of code because it increases the likelihood of the
object being promoted beyond Gen 0, which delays the object's resources from
being reclaimed.
I am using this type of Swapping in my application very frequently, if it
so, whether memory will grow,
can any one please suggest your valuable inputs in this, by how to handle
this type of scenario.
Here i am facing one technical issue related to Swapping the Object Instance
in Dotnet.
e.g..
class Customer{
Order _lastOrder;
void insertOrder (int ID, int quantity, double amount, int productId)
Order currentOrder = new Order(ID, quantity, amount, productID);
currentOrder.Insert();
this._lastOrder = currentOrder
}
this is my class, when i try to swap the currentOrder instance to
_lastOrder, what could happen for the currentOrder object memory, whether it
will destroy immediately or what is the stage. As per the Microsoft
suggestion avoid this type of code because it increases the likelihood of the
object being promoted beyond Gen 0, which delays the object's resources from
being reclaimed.
I am using this type of Swapping in my application very frequently, if it
so, whether memory will grow,
can any one please suggest your valuable inputs in this, by how to handle
this type of scenario.