Regarding Garbage Collection of struts2 Action objects

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Regarding Garbage Collection of struts2 Action objects

Manish(Java)
Hi All,
I am using struts2 with spring object factory.
Here, spring is creating action class objects  with request scope and
injecting service layer dependency and service layer objects are singleton scope.

here, even i have given request scope it doent ensure 100 % garbage collection of my all action class objects.

Can  anybody tell me, way so i can find all action objects garbage collected once action class has done
its work.

Thanx in advance.

Regards,
manish
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Garbage Collection of struts2 Action objects

vinodkashyap
Administrator
Hey Manish

there is no gurantee that garbage collector will run every time.

You can only make a call to it by System.gc() to ensure garbage collection.
But again its not sure

Reply | Threaded
Open this post in threaded view
|

Re: Regarding Garbage Collection of struts2 Action objects

Manish(Java)
thanx a lot Kashyap
But here my action's are of request scope so dont u think that once request is over,
action class should be gced.
Suppose in method i have created one object of method scope so dont u think
that once that method has done its work it will be gced immediately..

you can enlight on my idea,

Thanx in advance.

Reply | Threaded
Open this post in threaded view
|

Re: Regarding Garbage Collection of struts2 Action objects

vinodkashyap
Administrator
hi

its true!!
its is up to jvm to run gc

I already told you its not possible to force gc