LifeSpan of a Static variable

  • Thread starter Thread starter Jack Wright
  • Start date Start date
J

Jack Wright

Dear All,
I have declare a static object of my class in a WebService. What is
the life span of this Object? Will GC clean it up if it is not used or
accessed? Or Will the worker process keep it alive till it gets
recycled?

Please help

TALIA

Many Regards
Jack
 
Hi Jack:

The static will be around for the duration of your application. The GC
will not touch a reference your application can still reach and use.

HTH,
 

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

Back
Top