Life Scope

C

Chan

In MS' TimeTracker sample app, a middle-tier component BLL has a class
named TimeEntry. It's used in TimeEntry.aspx to remember a certain
state of an entry.

I must have missed something but just can not find a clue on its life
scope, as the more request for the page, the more resources used up
for this and eventually may impact the system. So, can any expert
explain,

1> what's the life scope of TimeEntry, and when it will be scraped?

2> how do we tell the GC not to touch it?

Thanks!
 
C

Cowboy \(Gregory A. Beamer\)

Chan said:
In MS' TimeTracker sample app, a middle-tier component BLL has a class
named TimeEntry. It's used in TimeEntry.aspx to remember a certain
state of an entry.

I must have missed something but just can not find a clue on its life
scope, as the more request for the page, the more resources used up
for this and eventually may impact the system. So, can any expert
explain,

1> what's the life scope of TimeEntry, and when it will be scraped?

I have not looked at the app, but here are some things to look at.

1. Is the cache through a static method? It could be eternal.
2. Does it also use Session ID to store (most likely)? Check Session_End for
clean up
2> how do we tell the GC not to touch it?

If you want to tell the GC hands off, you really cannot. But, you can set up
a static method to hold variables. As long as the app is running, the vars
will stay in memory and not be garbage collected, unless you delete the
values and allow the memory to be cleaned up.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
C

Chan

Thanks for the input.

1> There is no Session_End(). Is there a default place for
Session_End() in .NET?

2> The class is defined as "public", and it's created within the page
as

Protected _userInput As New BusinessLogicLayer.TimeEntry(0, 0, 0, 0,
DateTime.MinValue, Nothing, -1D)

So, it's not static either. Additionally, all it's New() constructor
are "public".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top