My component is getting garbage collected just fine. I just had to be a little patient I guess. I used jvisualvm at the command line which launches a GUI and I can do heap dumps and look at the object counts and filter the list to focus on my component and ERXECs.
After I logged out I did another heap dump and inspected the counts and the count had gone back to zero for my component and the ERXEC count had decreased to 1 which is just the session's default editing context. So everything is fine. Thanks to all! On May 25, 2010, at 7:32 PM, Ricardo J. Parada wrote: > > I'm not relying on the finalize for anything other than for a debug log > message to see in the console if my component is getting garbage collected. > > I'm just trying to get some indication that my component and editing context > do get garbage collected eventually. :-) > > Thanks > > > On May 25, 2010, at 7:12 PM, Q wrote: > >> >> On 26/05/2010, at 8:00 AM, Ricardo J. Parada wrote: >> >>> Hi All, >>> >>> I have a component with its local editing context. After the session >>> expires, I was expecting to see the finalize method in my component to get >>> called eventually, but it seems to stick around. So I wondered, how long >>> does a component stick around? Or is there a list of things to avoid to >>> prevent components from staying around forever? >> >> finalize() only gets called when the jvm garbage collector decides it needs >> to reclaim heap space and scavenges the object. This could take seconds, >> hours, even days from when your session expires depending on a number of >> variables and how the garbage collector is configured. Even then, there are >> no guarantees that the method will actually be called. As a rule you should >> never use finalize for any purpose other than to release underlying >> resources that the JVM doesn't do itself (eg. JNI allocated resources, >> closing held open sockets or files etc.) >> >> I am not sure what you are trying to do exactly, or why having a local >> editing context is relevant, but it certainly sounds like you might be doing >> it wrong. >> >> -- >> Seeya...Q >> >> Quinton Dolan - [email protected] >> Gold Coast, QLD, Australia (GMT+10) >> >> >> >> > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/rparada%40mac.com > > This email sent to [email protected] _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
