473,416 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

session.abandon and clear cache

I have an app that I can't seem to clear out server resources with a button
onclick event:

The session variables seem to be disappearing properly, but the
aspnet_wp.exe process stays where it had been upon running a heavy data
query. At a normal standstill it's at about 30-40MB and even after the code
below runs, it's up at 110MB.

What am I doing wrong?

Public Sub btnStartOver_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnStartOver.Click

Session.Abandon()
Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetExpires(Now().AddSeconds(-1))
Response.Cache.SetNoStore()
Response.AddHeader("Pragma", "no-cache")

End Sub

--
_____
DC G
Nov 19 '05 #1
3 3145

You're not doing anything that would free up resources on the server.

Your first line tells the browser to clear cookies from you. The next
4 lines instruct the client to clear up resources on its end.

If you have Database resources left hanging around, you may want to
investigate and make sure you're closing your connections and otherwise
disposing of things correctly. Look into the 'using' syntax, if you
have not already.

Good luck!

Jason
Expat Software Consulting Services
http://www.expatsoftware.com/

Nov 19 '05 #2
Jason,

Shouldn't session.abandon() clear it up?

It is the aspnet_wp.exe that is consuming the resources. I am fine with
what the database is doing...

______
DC G
"jasonkester" <ja*********@gmail.com> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...

You're not doing anything that would free up resources on the server.

Your first line tells the browser to clear cookies from you. The next
4 lines instruct the client to clear up resources on its end.

If you have Database resources left hanging around, you may want to
investigate and make sure you're closing your connections and otherwise
disposing of things correctly. Look into the 'using' syntax, if you
have not already.

Good luck!

Jason
Expat Software Consulting Services
http://www.expatsoftware.com/

Nov 19 '05 #3
ASP.NET strives to be essentially stateless, and you have to go out of
your way to make it behave otherwise. Unless you're explicitly storing
big things on the session (which you should not be doing), then
Session.Abandon() won't free much of anything on the server side.

My suspicion, that I voiced so poorly in my earlier response, is that
you have a resource leak somewhere. .NET is all about automatic
garbage collection, but it is still possible to leave resources like
database connections and file handles in an uncollectable state.
Something as simple as forgetting to call yourDBConnection.Close()
could leave that connection alive for quite a while after the page goes
out the door. This would manifest itself as an increase in memory
consumption in aspnet_wp.exe, the process that does all the work to
display your pages.

So again, I'd take a look at the code that does your database work.
Make sure that every disposable resource you use is declared with the
'using' syntax, and that everything closable gets .Close()'d before you
let it drop out of scope.

Hope this clears up some confusion!

Jason
Expat Software Consulting Services
http://www.expatsoftware.com/

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Nedu N | last post by:
Hi, I am trying to design a Home page for my applicatiion in which i want show the links for for some itms... I tried to put the following <td> <font face="Arial, Helvetica, sans-serif" ...
0
by: dummy_2600 | last post by:
I have an app I'm a trying to roll out to production in which Session.Clear() doesn't seem to be working for me. Basically we have multiple forms that make up a registration process. At the end...
6
by: JJ_377 | last post by:
In a "Save and Quit" button on my web app form (aspx), I have the following code that is supposed to clear a session variable (an user id) and redirect to a logon page: Session.Clear()...
4
by: Hugo Flores | last post by:
Hi all, I noticed that there are three methods that can remove session variables Session.Clear() Session.RemoveAll() Session.Abandon() Now my question as is stated on the subject, what is...
2
by: dave | last post by:
Hi all I'm newbie to asp.net and building simple pages using vb.net. I have got three pages default.aspx (which is login page), index.aspx and logout.aspx. In logout.aspx i have put following...
3
by: JJ_377 | last post by:
What is the difference between Session.Abandon and Session.Clear? Thank you.
0
by: 'Mani | last post by:
Hi All, I need to abandon a different session and want to know how to do this. Session.Abandon() will abndon only the current session associated with the current request. But, my necessity is...
2
by: Nathan Sokalski | last post by:
I have an application that is using Session state. On one page, I use the Session.Add() method to create the Key/Value pair for the first time. I am then sent to another page using...
16
by: Jonathan Wood | last post by:
Greetings, I was wondering if anyone here has a good understaning of the Session object. I know there are options like the Session.Abandon method and the regenerateExpiredSessionId setting,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.