Why do I get Memory Leaks in case 1, but not in case 2?

I recently investigated into memory leaks, since we got some when a Window is opened/closed several times.
I discovered the following behavior with ListView:
If I make several instances of a Window, which contains a ListView which uses a fix list as items, there are leaks. (Case 1)
If I make several instances of the ListView directly there are no leaks. (Case 2).
For me both cases seems equal, there's just another wrapper (the window) around the ListView in case 1.
Can someone explain what's going on?
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestApp3 extends Application {
    public static void main(String[] args) throws Exception {
        launch(args);
    ObservableList<String> items = FXCollections.observableArrayList("Item1", "Item2");
    public void start(final Stage stage) throws Exception {
        VBox root = new VBox();
        for (int i = 0; i < 100; i++) {
            SubStage subStage = new SubStage(); // Case 1
            subStage.show();
            subStage.hide();
//            ListView<String> listView = new ListView<String>(); // Case 2
//            listView.setItems(items);
        System.gc();
        System.out.println((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 + " KB");
        Scene scene = new Scene(root);
        stage.setScene(scene);
        stage.show();
    private class SubStage extends Stage {
        public SubStage() {
            ListView<String> listView = new ListView<String>();
            listView.setItems(items);
            Scene scene = new Scene(listView);
            setScene(scene);
}EDIT: If I use a TableView in the Substage, there are NO leaks. So is this an issue of the ListView?
Edited by: csh on 10.09.2012 07:40

There is file activity if Open Config Data.vi is being called.  The error is just due to not being able to find the configuration/.ini file.  Root cause could be a few things: the INI file was deleted/not moved/invalid path/whatever.  And the "create file if necessary" input to your use of Open Config Data.vi must be set to False for whatever reason.
Side note:
There were a couple changes to the Config VI's between v6 and v7.
If you were relying on using the default FALSE in Close Config Data.vi in LV6.1, you have to change your code.
From LV7 Upgrade Notes:
<snip>
• The configuration file path input of the Open Config Data VI is a required input. You must specify the configuration file path even if you open a reference to a configuration data object.
• The default of the write configuration file? input of the Close Config Data VI is TRUE. In LabVIEW 6.1 and earlier, the default is FALSE.
<snip>
=====================================================
Fading out. " ... J. Arthur Rank on gong."
Attachments:
OpenConfigData_v7Help.jpg ‏19 KB

Similar Messages

  • Why do i get text messages on my computer but not my phone

    why do i get text messages on my computer on my computer but not my phone

    You are getting iMessages, and they are going to your Apple ID email. Check the settings on your phone to see what you have checked for Send and Receive from, and then also check start conversation from. If you are sending from your Apple ID, this is what your friends are sending to.

  • Why do I get the message "Firebox already running but not responding"? I have to then restart the computer to get on the internet again.

    I go on the internet, the web site works, but then maybe when I try to go to another web site I get a message saying that Firefox is already running, but not responding and I need to close it or restart my computer. I do not know where to go to close that site so have to restart the computer!

    See:
    * http://kb.mozillazine.org/Profile_in_use
    * https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding

  • Why can I get a webcam on my IPad but not on another?

    Any IPad helpers out there?

    I'm not sure what you mean by "helpers". This is a user-to-user support forum. Lots of people do lots of helping.
    You're also going to need to explain your problem in a little more detail. If you mean why do some iPads have cameras and some don't, well, that's because Apple didn't include one in the first generation. All the subsequent models have them.

  • Why do I get a message that says "mail could not be moved to the trash"?

    WHy do I get a message that says "mail could not be moved to the trash" and how do I fix it?
    IPad 2 3G &amp;wifi

    1. delete this songs from your liblary
    2. go File -> Add File to Liblary... (Ctrl+O) or File -> Add Folder to Liblary

  • Why do I get the error message "iTunes Match could not download because disconnected from network?  I'm connected to the internet during that time with Safari so am I not connected to the network?

    Why do I get the error message "iTunes Match could not be updated because you were disconnected from the network during processing."  I'm on the internet during all of this.  What disconnect is the message referring to?  Itunes is frozen now.  I keep clicking OK but it just comes back with no action.

    Hello FredJay,
    Thank you for contacting Apple Support Communities.
    iTunes Match needs a network connection to work, either Wi-Fi, cellular or wired. See the following:
    Make sure you have an active Internet connection
    Be sure your computer or device has an active Internet connection by loading a webpage using Safari or another web browser.
    On an iOS device with cellular support, if you are not on a Wi-Fi network, try enabling 3G cellular data1 for iTunes Match.
    For iOS 6, tap Settings > iTunes & App Stores > Use Cellular Data > On
    For iOS 5.1.1 or earlier, tap Settings > iTunes & App Store > Use Cellular Data > On
    1Fees may be associated with downloading over cellular networks; contact your wireless carrier for details.
    From:
    iTunes Store: Troubleshooting iTunes Match
    http://support.apple.com/kb/TS4054
    Regards,
    Jeff D.

  • TS1718 Why do I get this message:  The song "title" could not be used because the oringinal file could not be found.  Would you like to locate it?

    Why do I get this message:  The song "title" could not be used because the oringinal file could not be found.  Would you like to locate it?

    John Black3 wrote:
    Many of my songs in my iTunes Library no longer play.  I get this error message: "The song xxx could not be used because the original file could not be found. Would you like to locate it?
    this usually happens when a user moves or deletes files in the finder - a sure way to upset iTunes.
    did you move or delete files in the finder ?
    I cannot locate the song.
    if you let iTunes manage your library, all your content will be in <MacintoshHD>/users/<yourname>/music/iTunes/iTunes music (or media)/music. did you look there ? tried a spotlight search ?
    if the files are really gone, and have been purchased from the iTunes store, see Downloading past purchases from the App Store, iBookstore, and iTunes Store.

  • Why do i get an error ( language code suply is not valid) while trying to sync with my ipad2

    why do i get an error ( language code suply is not valid) while trying to sync with my ipad2
    i'm using macbook pro and trying to share some photos with my ipad2. when i try to register my ipad i get this error.
    tnx,
    Dani.

    AMDS for Windows
    http://support.apple.com/kb/TS1567

  • Why I get double phone numbers and addresses but not notes within a contact when I sync iphone 4S with Outlook 2007?

    I get double phone numbers, double addresses, but not double notes, when I sync iPhne 4S with Outlook 2007. How can I prevent it from happening?

    Yes, I removed iCloud add-on from Outlook; and uninstalled iCloud.  I then re-installed, and sync would not work (no tab for sync in Outlook either). There was no improvement.
    However, since reading your post, I have just tried signing out of icloud control panel and signing in again....and now all si working as it should.  Weird!!
    Thanks for your assistance.

  • Why is my Apple id working on my MacBook but not my iPad?

    Why is my Apple id working on my MacBook but not my iPad? I can log in o.k. on my MacBook, but using the same user name and password on my iPad, I just get the Incorrect Apple ID or Password message.
    on my iPad, I have used the Forgotten Apple ID or Password link and reset the password. Even after I get the successfully reset password message it still gives me the Incorrect Apple ID or Password message!
    In desperation I have restored the iPad to Factory settings. It appears to be running OS 7. something.
    My Macbook is running 10.8.5.
    But the same problme persists.
    Please help

    I am having the same problem. Works fine on the website but telling me it's incorrect on my iPhone

  • Hi, I have had an LG Octane for 4 years and loved it. I used it for email, surfing the web and facebook. But 6 weeks ago I stopped getting text messages, I could send but not receive.  I was told it was just worn out.  So I ordered another Octane and it w

    Hi, I have had an LG Octane for 4 years and loved it. I used it for email, surfing the web and facebook. But 6 weeks ago I stopped getting text messages, I could send but not receive.  I was told it was just worn out.  So I ordered another Octane from ebay, and it wouldn't connect to the internet. I was told by Verizon that the software had been changed.  So I ordered a NEW in Box Octane and I am having trouble with that too. Bing won't work, nothing will work that will enable me to download Verizon Opera mini that still works on my old phone. I have a smart phone with another number but I LOVE the Octane for daily use. Why will my old Octane work but I can't get a NEW one to.  Verizon guys are stumped too:( Please help!!  Thanks!

    Why start a new and very similar thread to your other one which you have not responded to (have you read the replies?)
    I suggest that no response is made to this duplicate thread. 

  • HT1473 I am having to recreate my itunes library and do not understand why prior album artwork appeared in my older library but not the new library?  Is there some way to scan itunes for missing album artwork?

    I am having to recreate my itunes library and do not understand why prior album artwork appeared in my older library but not the new library?  Is there some way to scan itunes for missing album artwork?

    do you have a strongly recommended default "managed" library (the iPhoto preference to "copy imported items to the iPhoto library is in its checked state) or a referenced library - you have unchecked that option?
    It sounds like you have a referenced library and are now experiancing one of the very siginificant drawbacks of a referenced library and one of the many reasons they are strongly not recommended
    Also note that iPhoto '11 may use alises in the originals folder as part of the upgrade
    It is important that we understand exactly what you have and what is not sorking - what error messages you are getting
    You must NEVER make any changes of any sort to the structure of content of the iPhoto library - there are no user servicable parts in it  --  and you can not rebuild yoru librtary - only iPhoto ir iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ -  can rebuild a library unless you are a SQL programmer and understand the structure that iPhoto uses
    LN

  • Why do I see pictures of a different user but not my own?

    Why do I see pictures of a different user but not my own? Opening organizer in Photoshop Elements for the first time, I see pictures of my husband, but pictures in my picture library are not there. I do not want to see my husband's pictures. And he did not give me sharing permission. What can I do?

    Do you have two different catalogues  (One for you and other one for your husband)
    if yes,
    In Elements organizer go to File>Manage Catalogs and check if you have any catalogue listed of your name.
    if yes, double click on that catalogue and it will open the media on that catalogue.

  • I'm trying to get an appointment for 2 months but not get  an appointment.you help me.

    I'm trying to get an appointment for 2 months but not get  an appointmen
    My name's Burak. I'm writting you from Istanbul.I have a problem. My phone's not work.It's corrupt. I'm trying to get an appointment for 2 months but not get  an appointment.I went to apple store zorlu center. They did't help me. They tell me, you make an appointment to come. I want to sue them.

    You want to sue them?  Good luck, pal.  You can make an appointment up to 7 days in advance.  Here's what you need to do.  Keep checking the reservation page for the Apple Store you want to go to, and as soon as an appointment slot is available, take it.  Or go to the store as soon as it opens, and tell them you want the first available slot if someone cancels, and wait.
    Suing someone for being so busy that you can't make an appointment at their business is ridiculous.  You have no right to be seen before someone that A) Made an appointment or B) Has been waiting longer than you to be seen.

  • Hello, this might be a basic question, but how do you open QuickTime to record a new webinar? I have a new MacBook Pro with Yosemite and can only get QuickTime to appear in Finder but not actually open to allow me to record something new. Thx.

    Hello, this might be a basic question, but how do you open QuickTime to record a new webinar? I have a new MacBook Pro with Yosemite and can only get QuickTime to appear in Finder but not actually open to allow me to record something new. Thx.

    Hi Winterwilly,
    Welcome to Apple Support Communities. 
    The article linked below answers your question of how to use QuickTime to record something on your MacBook Pro’s screen.
    QuickTime Player 10.x: Record your computer’s screen
    Cheers,
    -Jason

Maybe you are looking for

  • Cash Journal- Due Date

    please i need your advice in how use or determine the due date for vendor lines posted from the cash journal? EX: we paid an employee advance payment posted with SP. G/L indicator X from the cash journal, when he returns a excess money we must determ

  • Can´t run ARES

    Hello. I tried to install ARES6.1 for several times. With no luck. When I try to access the webApplication on 'server:8080/ares' I get this error: HTTP500 'No Context configured to process this request'. It is a JBoss3.2.2, SunJava 1.4.2 (since the l

  • Joining Existing Wireless Network

    I have a Verizon Router. I want to connect my itunes to a stereo in the other room. I cant get the network to recognize the airport express unless it is plugged into the ethernet. Can anyone help me figure this out?

  • Yosemite screensaver problem. Constsantly reverts back to National Geographic.

    Has anyone found a fix to the screensaver problem? Nothing I try seems to work, including editing the Library files. Thanks.

  • MDSD : Problems in exporting Enhancement Project

    Hi Experts, I am having some problems in exporting the Enhancement MDSD project.... Please see the detailed description below.... Firstly I created a Standard MDSD project from MDSDSRC.zip file, then I created an Enhancement project from MDSD.jar fil