G
Guest
in production environment we started to have a memory consumption problem at
"asp.net wp". after a hard work we have discovered that Session.Abandon()
does not reduce references to objects added to the session and not reduce
memory use.
in Session_End function at Global.asax file we have added the following
lines of code:
== == == == == == == ==
for(int Item = 0; Item < Session.Count; Item++)
Session[Item] = null;
== == == ==
as i suspected it still does not free memory. finally a new line of code was
added "GC.Collect()":
== == == == == == == ==
for(int Item = 0; Item < Session.Count; Item++)
Session[Item] = null;
GC.Collect();
== == == ==
after all of this the memory was free!!!.
Questions:
why Session.Abandon() does not reduce object references?
why Session.Abandon() does not internally force a colecction in order to
free memory?
"asp.net wp". after a hard work we have discovered that Session.Abandon()
does not reduce references to objects added to the session and not reduce
memory use.
in Session_End function at Global.asax file we have added the following
lines of code:
== == == == == == == ==
for(int Item = 0; Item < Session.Count; Item++)
Session[Item] = null;
== == == ==
as i suspected it still does not free memory. finally a new line of code was
added "GC.Collect()":
== == == == == == == ==
for(int Item = 0; Item < Session.Count; Item++)
Session[Item] = null;
GC.Collect();
== == == ==
after all of this the memory was free!!!.
Questions:
why Session.Abandon() does not reduce object references?
why Session.Abandon() does not internally force a colecction in order to
free memory?