Cannot remove JTable from memory

Hi,
I am new to this forum so please forgive me if I make some naive errors. We are developing a component-based software in which the GUI can respond to a user's click to show a JTable in a JPanel. Because the loading of the JTable might take a while since some of our data can have a million columns (I cannot help that), we used a thread to manage the loading of the JTable. So the process is as followed:
1. In a method called "invokeThread", we first get an instance of the JTable as in the code (IVComponent is an interface that our JTable-derived table implements):
final IVComponent returnComponent = VComponentLoader.getVisualization(tableName);2. Then in the method "invokeThread", we start a thread and uses the SwingUtilities.invokeLater() to load the JTable:
        Thread executeThread = new Thread ("Table Thread") {
            public void run () {
                SwingUtilities.invokeLater (new Runnable () {
                    public void run () {
                        loadTable(returnComponent);                       
        executeThread.start ();3. The "loadTable" method is in the same class as the "invokeThread" class. It loads data into the JTable.
This works fine to load the data into the JTable. However, once the JTable's use is finished and the user wants to get rid of it to save on JVM memory, we allow the user to delete that JTable. Now the reason I am asking for help is that although we can set the JTable to null or set its TableColumnModel to null before setting JTable to null, we found that the TableColumns in the TableColumnModel are still on the heap using Eclipse's memory analyzer or Netbean's profiler. We were surprised that neither tool told us which object held them in memory, though.
We have looked on the web for a while. First we thought the "final" keyword might be the problem but using an instance variable for the class in which the method "invokeThread" resides did not help. We have seen other people reporting similar issues with other swing components but has yet to find a solution or a work-around that works for us.
Thanks in advance for your help.
John

Thanks, PhHein. If we can bribe the GC, we will :-).
I guess my question is whether this is something we need to do to ensure that GC will collect the memory once we set the JTable to null. From what we gathered on the web, one possible reason for the GC not to touch the JTable is that there is another reference to the JTable object (or its sub-components?) that we are not aware of. We saw a few posts mentioning the listeners added by a static object. Don't know if it applies to our situation because although we did not add any listener this way, we don't know whether by using JTable and TableColumnModel, a listener is added for us by a static object.
With limited exposure to the development community, we don't know the scope of the issue we encountered. We have seen a few bug reports in sun development network but they were quite old. If this is a well-known issue for Swing components that is yet to be fully addressed, then we have to bite the bullet for now. If there is a solution either offered by sun or by some experts, we will be grateful if you guys can point the way.
Best,
John

Similar Messages

  • I just recalibrated my battery and now cannot remove anything from my dock. Don't know if this has anything to do with it or not. I have moved it up the screen and held it and still returns to the dock. What now?

    I do not know if this has anything to do with my problem or not. I just recalibrated my battery and now cannot remove anything from the dock. I have moved it half way up and held it and it just goes back to the dock. Will not let me even put it in the trash. I am new to the macbook so would you please help me?

    There is NO calibration on a modern macbook
    Battery calibration, battery memory, battery overcharging, battery training, …all these concepts are mostly holdovers from much older battery technology, and on older Apple portable Macbooks ranging from early nicads, NiMh and otherwise; and these practices do not apply to your lithium battery and its smart controllers.
    Current Apple portable computer batteries are pre-calibrated and are not to be calibrated
    http://support.apple.com/kb/ht1490
    There is no battery calibration with current Apple portable Macbooks with built-in batteries. Lithium batteries have essentially a 0-‘memory’, and all such calibration involve the estimations fed to the system controller on the SOC (state of charge) of the battery over long periods of time as the battery degrades. The software based battery controller knows the battery's characteristics, or SOC and adjusts itself. This is why there is both no need and purpose to periodically deeply drain your macbook battery, since it doesn’t affect the characteristics of the battery, and further still deep discharges are something you should not do on purpose to any lithium battery.

  • How do I remove an old phone number from my macbook imessage. My apple ID does not show the number anymore but I cannot remove it from the imessage accounts. Its driving me mad !

    Can someone please help me to remove an iphone telephone number from my imessage application. I no longer have a phone which I registered on my apple ID as a second phone. I have been on my apple ID and it does not seem to be there but cannot remove it from imessage, which still has it as an option to connect to. I am concerned that someone else who inherite this old phone will see my messages if I accidentally enable it again. I have read and re-read various postings and tried all options given but no luck, the **** thing stays there.....

    Hey Chappers64!
    Here is an article that will help you with this issue:
    iOS: Deactivating iMessage
    http://support.apple.com/kb/ts5185
    If you have already tried these steps, you will want to utilize the information at the end of the article:
    If you can't deactivate iMessage after you perform the steps above or you can't access the iPhone, please contact Apple Support.
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • When I plug my ipod in I am able to add song to it but the tab that says "on this ipod" no longer shows up so I cannot remove things from my ipod or anything like that. How do I change this weird setting?

    When I plug my ipod in I am able to add song to it but the tab that says "on this ipod" no longer shows up so I cannot remove things from my ipod or anything like that. How do I change this weird setting? On other computers this shows up fine so it is clearly a problem with itunes and not my ipod.

  • My email address changed and now I cannot remove it from cloud on my iphone 5s in order to back my phone up and download apps now

    my email address changed and now I cannot remove it from cloud on my iphone 5s in order to back my phone up and download apps now

    If you are trying to change the iCloud ID on yoru phone from an old ID ("email address") to your current ID, and if it is an earlier version of your current ID, go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • I cannot remove songs from iCloud - how can I do it without paying for iTune match subscription?

    I cannot remove songs from iCloud - how can I do it without paying for iTune match subscription? Different answers in this forum make it iTune match enabled. But enabling iTune match cost me $24. Help please.

    You are correct, you cannot delete songs from iTunes in the Cloud. This is where all of your purchases are permanently stored so if you want to re-download something you can. Sometimes purchases will no longer be available, if the merchant pulls them from the iTunes store, but for the most part, all of your past purchases will remain in iTunes in the Cloud.
    This has absolutely nothing to do with iTunes Match.
    What is the issue you are experiencing?
    Cheers,
    GB

  • Cannot remove movies from ipad under normal conditions with itunes

    Have three films loaded into ipad mini but i cannot remove them. Two are in my musi/itunes/movies directory on my pc but a third is on the ipad but not on my portable. if I try to download them afresh from the itunes store they just get added again to the storage and i run out of memory. These fims seem to have been loaded in a pevious version of the ipad ios system.
    Is there any other way to get rid of them as connecting by usb only allows access to the photo library.

    ... it works. The problem was in front of the computer ...

  • 10g: Cannot remove package from "model" (business components)

    Using the new 9.0.5.1 JDev. I have removed all of the object in a package.Security package, because i did not want the capital letter in the package name (suspected of causing some other problems in my workspace). I cannot create a package.security package at all now. after just browsing the project defination, and looking in some other xml files, I see that the package is still defined all over the place, even without files in it.
    Why is this persisted? Shouldn't it be cleaned up when the last file is removed?
    Or at least, shouldn't I be able to remove it from my project without hacking all the XML code?

    package is an illegal name for a package in Java, I believe, so let's assume you started with "test.Security" package name.
    I filed Bug# 3574928 for the problem that exists in trying to "Move to Different Package..." if the destination package only differs from the target package by a different of case.
    The workaround in the meantime is to:
    1. Shift-select components in "test.Security" package and right-mouse "Move to Different Package...".
    2. Use a package name temporarily like "test.security2"
    3. Do "View | System Navigator" to see the System Navigator.
    4. Use System Navigator to erase the "test.Security" package by clicking on the BC4J package and right-mouse "Erase from Disk..."
    5. Close the project, and reopen it.
    6. Shift-select components in "test.security2" package and right-mouse "Move to Different Package...".
    7. Specify "test.security" as the target package.

  • Removing items from memory using loop

    The following for loop removes children from their parent if
    they're in the display list. It works correctly, but I also want to
    remove each child from memory with the same loop. I can't get it to
    work correctly however.

    I have tried multiple items in the loop to set each child to
    null before or after it's removed.
    Here are some:
    this.child = null;
    var target = this.getChildAt(0);
    target = null;

  • Does PopUpManager "close" event remove PopUp from memory?

    I'm using a lot of popup windows (in addition to tooltips) in an application.  Does the PopUpManager's close event remove the popup from memory?  If not, I'd like to find out how this could be done.
    Thanks.

    on close, you need to call PopupManager.removePopup(this) here this is the popup. and make sure that this popup does not have any strong references/event handlers listening to custom events /events

  • Cannot remove songs from playlists in the latest iTunes version

    I am running iTunes 11.1.5.  When I select a song or songs in a playlist that I want to remove from the playlist (but keep in iTunes) and hit the Delete or Backspace key nothing happens.  What's strange is I am able to remove songs from some of my playlists but not others.  Does this behavior work differently in playlists I create myaself and playlists iTunes provides for you?  It seems I can remove songs from my own playlists but not from the ones provided by iTunes.
    Thanks.
    Jesse

    You cannot manually add or delete from smart playlists (they appear in purple in my iTunes and at the top of all the playlists).  Smart playlist content is generated by the rules controlling the playlist.  Right (control+) click on a smart playlist to see the rules.

  • Firefox downloaded with a virus cannot remove program from my computer.Have tried normal removing i.e control panel remove program I am a new user

    Firefox has a virus attached. I download without an anti virus program in place.I now cannot remove current version of mozilla 3.6.3 from my computer. I've tried =control panel= add and remove programs nothing happens. I have all kind of problems trying to open mozilla and it constantly freezes and almost ever session displays restore session box. I would like to be able to remove this version and download again with anti-virus in place. I am new to using a computer and a lot of what I do is trial an error but I have always been able to add &remove programs. Thank you
    == This happened ==
    Every time Firefox opened
    == I downloaded

    Help->Troubleshooting information
    Copy contents of the webpage
    Paste them into your reply
    Help->Troubleshooting information
    Find on this page this part of table
    Build Configuration about:buildconfig
    click "about:buildconfig" link
    copy contents of this page
    paste them into your next reply
    (separately from contents of previous page)
    If possible, give link to the web-page from which you downloaded Firefox.
    Are you opening Add&Remove programs as the same user which installed Firefox?
    --------------------------------------------

  • I cannot remove Avast from Safari.  It is blocking a website that I need for remote access to my office.  I have dragged Avast to the trash and have restarted my computer.  It is no longer installed as an app on my Mac.  Does anyone know what to do?

    How do I remove Avast from Safari?

    "Avast" is perhaps the worst of the whole wretched lot of commercial "security" products for the Mac. Not only does it fail to protect you from any real danger, it throws false warnings, destabilizes and slows down the computer, and sometimes or always corrupts the network settings and the permissions of files in your home folder. Removing it may not repair all the damage.
    Back up all data, then remove "Avast" according to the developer's instructions. Restart.
    If you tried to remove Avast by dragging an application to the Trash, you'll have to reinstall it and then follow the instructions linked above.

  • Remove Control from Memory

    I've written a VI using VI Scripting that creates an Enum based on an array of Names.  For example, if I have an array with "Initialize", "Process", "Exit", I can create a control "State.ctl" consisting of an Enum with these values.
    The trouble comes from wanting to "redo" (i.e. re-run) this VI, say because I want to add another state, "Clean-up".  If the original VI is in memory (because I'm developing code, and have used it), when I run my Create Enum script, it gives Error 1357 when it tries to write State.ctl, saying it is already in memory.  One solution is to exit LabVIEW, restart, and run fresh, with the control-to-be-overwritten not (yet) in memory. 
    Is there a way to Have My Cake and Eat It, Too?  Can I write a VI that will inquire if State.ctl is in memory (for example, by wiring just the name to an Open VI Reference and seeing if there is no error, which means it's in memory) and then purging it from memory?  If so, I could avoid the 1357 error.
    BS 

    The All VIs in Memory App property will tell you whether or not the control is still in memory.  Alternately, you can try opening it with just the name instead of a full path.  If it is in memory, the open will succeed.  If the open succeeds, just add the new item.  If not, create the whole thing.
    Closing something in memory is tricky, since LabVIEW has all sorts of optimizations to keep things in memory and so avoid reloading.  You would need to ensure all callees are closed, at the least.  You could do this by recursively calling the VI property Caller's Names until you get to the top.  Close everything and it should eventually go out of memory.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Cannot remove music from iPad. Why?

    I need to remove music from my iPad to create space to import movies. However, via iTunes/Sync even though I uncheck the Sync Music box I find that the music remains on my iPad. What am I doing wrong?

    It should remove the music once you click on your phone in the left pane and go to the music tab at the top of the iTunes screen. I have tried this myself just now with my iPhone 4S. Once I deselected sync all music, the capacity bar at the bottom changed to show no music. If I had selected sync, all my music would have been removed from my phone.
    Since you removed the music from directly from the phone and not iTunes, once you connect to iTunes and sync, the same music will be synced back onto the phone.
    Try playing with the settings and see what you come up with. Also, try closing iTunes and restart your computer amd see if this fixes things.

Maybe you are looking for

  • Exploded directory format in an EAR

              I have a problem wrapping up an exploded directory format application into an ear           file running weblogic 6.0sp2 on winnt 4. One of the things I would like to do           is load a config file from a helper class without specifying

  • Unselect tree node in tree

    Hi, I have tree on page and would like to deselect selected node without selecting any other node in the tree i.e. no node selected in tree. Any suggestion, how can it be achieved. Thanks.

  • Truncate on a partitioned table

    hi all. A table has some paritions.I try to delete all rows from one of these partitions. How to use truncate to do this? Regards Bacer

  • Transitioning to Single Mode Fiber

    Hello,  We need to install new fiber to some new buildings in our school district. I want to be able to use current switches that I have in the old portable buildings that will be turned down this summer. My idea was to use Single Mode Fiber for thes

  • User Object - Where can I find the info?

    Hi, I have been browsing through the ALI doc's however I cannot seem to find any information on the various objects that are presented in ALI. In particular I want to find out what is being returned when I query the user object or a session etc? Than