Right way to dispose frame/components/containers?

Advertisement
October 11

Hi,
My application creates a lot of frames with lots of containers and components (heavyweights as well as light weights) inside them. I have obeserved that none of the frames/containers/components get finalized unless I do a remove/removeAll() over the respective container. Currently I just make a call to frame.dispose() to dispose it off and assume that all components would be reclaimed by the garbage collector at some point of time. Is that the right way to dispose off the frames and mark all its child components for garbage collection? Or is an explicit call to removeAll() required to release the memory. I am aware that garbage collection doesn't happen immediately and may take a while before the GC collects objects. I have run the application continuously for couple of hours and created/disposed a lot of frames during that period. GC recollected none of them (none of the components either) except for those that were removed by an explicit call to remove or removeAll during the lifetime of the session. I even hit OOM errors but none of the components were recollected.
What could be the problem?
Some additional information:
I overridden removeNotify() and finalize() methods to see what's going on. For all components removeNotify() was called (even if I don't do explicit remove/removeAll and just dispose off the frame) but finalize never gets called. My methods:
     public void removeNotify()
          super.removeNotify();
          System.out.println("Remove notify called "+compId);
     protected void finalize() throws Throwable
          super.finalize();
          System.out.println("Finalized component "+compId);
     }Thanks in advance.
Edited by: crack_it on Jul 31, 2009 8:52 AM

Advertisement

Replay

Sorry to bother guys. The problem was not with AWT but with one evil component that was displayed inside most of my Frame classes and was also registered as an Observer with an Observable class. The event at which the component was supposed to unregister itself with Observable never got fired and this one reference prevented garbage collection of entire gui brigade. Damn! Tiny monster.
Anyway the issue stands resolved. Thanks for your time.

View 2 Replies

What is the right way to change the active JInternalFrame for and MDI app?

November 30

I am working on my own implementation of the window menu. The action that is triggered when a customer chooses a window to activate from the list in the menu is not behaving as I expected. The code I wrote (below) switches frames correctly but the ca

View All Replies

Any way to get frame accurate in icon view mode?

October 11

Does anyone know if there is a way set frame accurate in points in icon view mode?  I know that if you are "hover scrubbing" a clip, and then click on it you can use the JKL keys to shuttle through the footage.  But is there any way to go frame-

View All Replies

Right Way to change MBOs Connections

October 11

Hellow Experts, I'm really enjoying the communication here, and I got a new one. Whats the right way of change MBOs Connections to SAP for instance? I tried 2 methods. Method One Title: Its just too much Work Proceeding: I start rebinding every MBO a

View All Replies

What is the right way to handle events?

November 30

What is the right way to handle events? If I start doing stuff in the AWT event thread (particulaly things that create their own events) should I be starting a new thread? A link to a good book or reference source will do thanks in advancehttp://java

View All Replies

I have iPhone 4s and i switch find my iphone on ! my problem that i have kids who know my apple ID and they put it like more than 10 times and they block it. my iphone wouldn't open or format in right way. plz help

November 30

i have iPhone 4s and i switch find my iphone on ! my problem that i have kids who know my apple ID and they put it like more than 10 times and they block it. my iphone wouldn't open or format in right way. plz helpIf your kids blocked the phone by re

View All Replies

What is the right way to connect the adapter to my macbook when charging?

October 11

what is the right way to connect the adapter to my macbook when charging. is it connect the magsafe connector first before plugging the adapter to the outlet? or the way around? or both ways will do? what if i'm using a surge protection with a on/off

View All Replies

[Solved]Bash:Manipulating arrays of paths? the right way or not?

November 30

Note: Refer to the following posts for better solutions and/or alternatives. This is a mock segment of a script I'm writting and I need to know if I'm doing it the correct way or at least in a proper bash way... the following works but will it always

View All Replies

What is the right  way to re-format idop's Classic Hard Disk?

November 30

Since my ipod classic 160 GB is malfunctioning, after I did a lot of restores trying to fix it without success, I've done a HDSMARTDATA test with the following results: Retracts: 2 Reallocs: 9880 Pending Sectors: 0 PowerOn Hours: 16 Start/Stops: 296

View All Replies

Right way to "Share" with iDVD

October 11

I just tried to share a 30-second clip to Media Browser and it will apparently take 10 minutes. Sharing to iDVD seems to be quicker but doesn't seem to actually work with iDVD (at least not for me). What's the right way to send movies to iDVD - both

View All Replies

What is the right  way to display a table in Java web dynpro using a node.

October 11

Hi experts,   I am trying to show a node of cardinality 0...n as a table in an adobe form in Java web dynpro. But its not showing it properly. Can anybody please tell me what is the right way to display a table on adobe form using a node of cardinali

View All Replies

Putting a CD & DVD in the Drive? am i'm doing it The Right Way?

October 11

i'm little bit new to this iMac cause i just bought a iMac 24 inch Computer in July of 2009 & i needed to know this, when i put a CD or DVD in My iMac Computer am i'm soppose to push The CD & DVD into The iMac Computer? or is there soppose to be a

View All Replies

Using StAX with xslt transformations in the right way?

October 11

Hi! What do I need to enable the stax functionality to transformations, and which transformer implementations is supporting this? (or is the implementation irrelevant) I have made the following to create a StaxSource, but is it enought? ---8<--- priv

View All Replies

Frame components still remain after frame.dispose()

November 30

hi all, I have a frame which consists of menu pane(Jmenu), action panel(buttons for popups), navigation panel(buttons) and content pane. When a user log in, he can see his own set of menu,action panel etc.. and when he logout, i use frame.dispose() t

View All Replies

Solaris containers, am I thinking in the right way ?

November 30

Hi there, I've downloaded Solaris 10 and so far I really like what I see. With all the exploits appearing on Linux (local root exploits in the kernel for example) I'm seriously considering to replace my Debian GNU/Linux environment with Solaris 10. O

View All Replies

Why is their a black bar on right side of last frame?

October 11

Since the most recent update I have black verticl bar on the right side of the last frame in Premiere Pro CC. I have tried cutting, reducting expanding, everything I can think of, but to no avail. Has anyone else experienced this and if so, do you kn

View All Replies

Right way to do software trigger?

October 11

I have been doing a program for electronics dropping tester. I am using one drop table sensor and one sensor attached to circuit board. I am dividing all 250kS/s rate two these two sensors. Also when I am using high speed resistance measuring in test

View All Replies

[Solved] What's the right way to install/upgrade virtualbox ext-packs?

October 11

I'm a little confused about how one should go about upgrading the ext-packs for virtualbox. It doesn't look like pacman -Syu covers ext-packs, so I'm wondering whether using the AUR package is the correct way to upgrade ext-packs. Any feedback will b

View All Replies

Moving Home folders onto external HDD, what's the right way to do it?

October 11

At the moment I have my network accounts on the Server's boot disk, but I want to move them onto an external disk. I was thinking I should rsync the Users folder with the external, but do I then have to edit each account in Workgroup Manager to point

View All Replies

Is this right way ro save html file as excel file

October 11

Hi all Iam saving html page as excel page .Source code for this is BufferedWriter out = new BufferedWriter(new FileWriter("c:/Excel/price.xls")); BufferedReader in = new BufferedReader(new FileReader("C:/html/price.htm")); String str;

View All Replies

Tags:

  1. iphone 4 does not regonizes sim card
  2. add puffin to ipad ios 5.1
  3. imovie program for a1151
  4. walkman fix force close
  5. FCAREGUL
  6. 305500 non oracle exception
  7. Using the load TXT
  8. NL3I
  9. ordinaryphq
  10. hurry94m
Copyrights 2019 Fcffair BigData Resource, All rights reserved