Window Memory usage even after closing windows

I've included links to a test app that does nothing but
launch a window, play a sound, close window / repeat.
When application launches it uses about 20mb of memory. When
you click on the only button, it will launch a secondary window
that will simply play a wav file. (I set the volume low but you may
want to mute it :D)
After launching and closing the window several times the
memory usage goes up considerably and *never* falls back a
significant %. (I got it to about 100MB before I decided to quit
trying to increase the memory usage. Right now it's been running
w/o any user interaction since opening about 10 windows and it's
fairly stable at around 61MB (although that appears to be
increasing w/o user interaction).
Does anyone know of any methods I can use to ensure that the
memory consumed by secondary windows does not just persist forever
even after closing the window? Is there something I'm doing wrong
here?
Example Code:
http://www.vf-server.com/air/memorytest.air
(AIR)
http://www.vf-server.com/air/memorytest.zip
(source ZIP)
Note: When I *minimize* the window it looks like garbage
collection is forced and app drops back to 11MB (on restore back to
19mb).
Edit: note in your task manager, application appears as
JBTest.exe

You can call System.gc() to force the garbage collector to
run.
Try removing the event listeners when they aren't needed
anymore. I think it is more difficult for the gc to cleanup objects
when there are host objects (like Sound) refering to JavaScript
objects and JavaScript objects refering to host objects, so you
need to be especially careful about those. It SHOULD clean them up
eventually, but it may take longer for it to figure out that those
objects are no longer in use.
You might also clear the secondaryWindow reference in the
parent document when the window closes. That reference might retard
garbage collection, too.

Similar Messages

  • Black window remains open even after closing the window programatically

    I have an application which has multiple windows. From mainwindow button click event I am closing the child form of the application. The child window is opened after a successful socket, serial or gateway connection attempt, after which the application
    do work with some threads and while clicking on a button on mainwindow I am closing this child window after disconnecting the respective connection mode. But after the close event the child window background gets black and it remains open unless and until
    I just do a minimize and maximize the application. Please help me on this to get this issue fixed.

    Well the details are rather going to depend on what it's doing.
    It's a very open ended question really.
    But...
    Your options include.
    Background worker.
    https://msdn.microsoft.com/en-us/library/cc221403(v=vs.95).aspx
    DIspatcherTimer
    https://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer(v=vs.110).aspx
    Async Await
    https://msdn.microsoft.com/en-us/library/hh191443.aspx
    Tasks
    Task.Factory.StartNew(() => { Dosomething(); });
    Or just a plain thread
    using System.Threading;
    new Thread(() =>
    Thread.CurrentThread.IsBackground = true;
    // DoSomething();
    }).Start();
    Where DoSomething is a method.
    You can also have inline code of course instead of a method.
    Whilst on a different thread to the UI you can't update UI objects.
    You'll get a thread affinity error message if you try.
    That means you either return your results to the ui thread and process them there ( particularly convenient with async await ).
    Or you update something which doesn't have thread affinity.
    An observablecollection bound to an itemssource doesn't have thread affinity eg.
    You do need to raise property changed at the end of your processing with that option because it notifies collectionchanged on the wrong thread and the UI won't know it changed.
    Or you can dispathcher.begininvoke to get back to the UI thread.
    All depends what you're doing but hopefully one of those options there will suit you.
    Hope that helps.
    Recent Technet articles:
    Property List Editing ;  
    Dynamic XAML

  • Why do I keep getting the windows messenger error even after disabling it?

    Hi,
         I am trying to download the flash player 10 on my windows XP computer. I get the error(s) close "Internet Explorer" and close "Windows messenger" during download. I closed Internet Explorer ok, but still keep getting the Windows messenger error even after stopping it and disabling it. I also have IT on medium and firewall and antivirus disabled.
       How do I fix this problem. Please help. I need a flash player for work...Thanks
    Nitrowizard88

    ok, Here is whats listed
    flash10l.oxc active x control
    flashinstall, log
    flashutil10l_activex.dll
    flashutil10l_activex.exe
    genuist.exe
    kb923789.inf
    install.log
    I think I am running IE7
    32 bit..not sure on this...

  • Can't open any windows in Safari even after re-install

    I can't open any windows in Safari, even after installing Snow Leopard, not even the "About Safari" info window. I'm using Firefox to get online. I can open the program itself, but can't do anything else. I'm suspicious that it may be a virus, because I'm getting some weird messages on restart, such as asking me if I want to use some wireless network I never heard of, and if I want to give somebody access to my Twitter account - very strange. My son was using a website when this happened.
    Message was edited by: Alba17

    Greetings,
    I'm suspicious that it may be a virus
    Not possible, since there are no viruses for Mac OS X. You should ask your son what site he was one and whether or not he downloaded and installed anything. And you should turn off wireless networking and delete any networks that you didn't specifically setup. Use Ethernet to connect to your modem/router for Internet access.
    Are you sure that Twitter is asking to give somebody access to your account, or just authorize them to follow your tweets? I've never seen Twitter do the former for anyone, ever.

  • After closing [window X] then opening new/different [window Y] from 'library' etc (Y) opens normally with undesired 'tab' of (X) Intentional? If so, adjustable and how??

    After closing [window X] then opening new/different [window Y] from 'library' etc> (Y) opens normally with undesired 'tab' of (X)> Intentional? If so, adjustable and how??

    If you click on the bottom library what is the file path that is  displayed?
    Try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iPhoto folder (Snow Leopard and Earlier).
    or with Mt. Lion from the User/Library/Containers/com.apple.iPhoto/
    Data/Library/Caches/com.apple.iPhoto folder
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    NOTE 2:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    OT

  • FIrefox 4 beta does not work anymore. Directly after start-up (my homepage is showing) is firefox hanging, showing an hour glass. No button, URL or whatever can be used, except for the close button. But even after closing firefox, it keeps on running.

    Even after closing down the application, the firefox task remains running in the background and must be killed with Windows Task Control.
    Even deinstalling and installing the latest beta version does not solve it. Unfortunately I have to use Google Chrome Now.

    Ok. I disabled hardware acceleration. The only extension is the McAfee Scriptscan for Firefox 15.1.0, which was already disabled. I then disabled all plugins (Acrobat, Google Update, Intel Identity Protection (2x), Java Deployment Toolkit, Java Platform, MS Office 2013, Quicktime, Shockwave, Silverlight), which were all up to date.
    Normal or safe mode still has same result. No startup, no option button and no customize.
    Thanks for your help. Got any other suggestions?

  • Firefox apears in firewall even after closing all processes and continues to download file

    firefox continues to download files even after closing all the processes, this behavior was noticed by looking at the my firewall activity log. I am using get them all download manger (firefox extension) to download files in firefox. When first time firefox is started after starting computer it doesnt have any problem, but once I open the download manager and start downloading files it never stops.
    I am using : down them all version 2.05 beta on FF 3.6.12
    1. start computer
    2. open firefox
    3. check firewall status (bitdefender firewall running at report level) - no activity noticed
    3. add url to download file in download them all manager
    4. start download - bitdefinder shows firefox accessing internet
    5. pause download
    6. check firewall status - bitdefinder doesn't show firefox accessing internet in process listing but it does show network activity is going on at its peak.
    7. close all firefox windows and remove firefox.exe from task manager
    8. check bit defiender firewall status it continues to run at peak eating up all the network bandwidth
    9. remove rule of firefox from firewall so as it may prompt when firefox try to connect to internet (bit definder firewall is running in report mode for approval for each connection)
    10. as soon as rule removed, bit definder pops up window sayaing firefox is trying to access remote server (same from where the download was earlier started)
    11. Allow the firefox to access it and again it will start downloading in background and bitdefinder shows up internet activity at its peak.

    naah, looks like its problem of firefox, i removed the plugin and tried downloading using the normal download winodw of firefox but same problem, this time it starts picking up item from the download window and continues to download

  • 0.5 MB program has 832 MB memory usage even before it is run

    I just uninstalled and re-installed LabVIEW 2011. I was hoping this would do something to lower the memory footprint. Alas, it did not make any difference. This is what I see:
    - When I launch LabVIEW, it uses 94 MB even before I have opened a single VI, i.e. only the front end uses this much memory.
    - When I open the VI (the size of the .vi file is 549 KB), memory usage goes up to 836.4 MB. This is before I have even run the program.
    - Finally, when I run the program, memory usage jumps to 1.17 GB.
    I find this memory usage grotesquely high. Can anyone please shed some light on what can be done? I have uploaded the VI. It's a rather simple VI.
    Thanks,
    Neil
    Attachments:
    IP QL to charge - from img.vi ‏446 KB

    nbf wrote:
    1) If I understand correctly, what you are saying is that when I open the VI, the data structures associated with the intensity charts and waveform graphs are initialized to default values (e.g. 0), so there is memory usage even before the program is run and anything displayed, right?
    Yes, a huge array still takes a lot of memory, even though it compresses well for storage inside the VI. Once the VI is ready to run, these arrays need to be allocated in memory.
    nbf wrote:
    2) Is there an alternative to using the value property node that doesn't duplicate the memory content? (e.g. something like pointer or reference in C++?)
    One possiblity are data value references. You can open a DVR and fill it inside the subVI, then extract slices later as needed. If done properly, you can also keep the 2D data in a shift register (yes, please learn about them!).
    nbf wrote:
    4) Regarding the clearing of the indicators, could you please tell me how to do that, without removing the color ramp settings?
    The color ramps can be set programmatically using property nodes based on array min&max and you can assign colors for the ramp values at will.
    nbf wrote:
    5) You are correct that I am displaying 4000x2000 array data in an intensity graph with 400x200 pixels. But then I change the min/max of the charts/graphs to zoom into the region of interest; I can identify the region of interest only after displaying the full 4000x2000 array of data. I don't know if there is a way around this.
    Do you really need to show the 2D data in three different transforms? Maybe one intensity graph is sufficient. You can apply the other transforms on the extracted slices with <<1% of the computing effort. What is the range and resolution of your data? Do you really need DBL or is a smaller representation sufficient (SGL, I16, etc). From looking at the subVI, the raw data is U16. The subVI also involves a coercion to DBL, requireing another data copy in memory. When running, make absolutely sure that the subVI front panel is closed, else additional memory is used for the huge array indicator there. For better performance, you might want to flatten the subVI to the main diagram or at least inline it.
    nbf wrote:
    6) Yes, I use the continuous run mode instead of a toplevel while loop. Is there a disadvantage to doing that?
    As Samuel Goldwyn ("A hospital is no place to be sick") might have said: "Run continuously is no way to run a VI"
    Run continuously is a debugging tool and has no place in typical use. What it basically does is restart the VI automatically whenever it completes, and as fast as the CPU allows. It is mostly useful to quickly test subVIs that don't have a toplevel loop and play with inputs to verify results. Any toplevel VI needs a while loop surrounding the core code. Period!
    So, my suggested plan of action would be:
    Use a while loop around your toplevel code
    Decide on the minimal representation needed to faithfully show the data.
    Keep a single copy of the 2D array in a DVR
    You optionally might want to undersample the data for display according to the pixel resolution and use other means of zooming and panning. For zooming, you could extract a differently sampled small array subset and adjust x0 and dx of the axes accordingly.
    Use a single 2D graph (if you need to see the various transforms, add a ring selector and transform the 2D array in place. Never show more than one intensity graph.
    See how far you get.
    LabVIEW Champion . Do more with less code and in less time .

  • Hardware acceleration in Firefox 4 fluctuates my gpu clock speed and for some period of browsing will hang the gpu at the highest clock speed available even after closing Firefox 4.

    After browsing heavily in Firefox 4 for some time, my gpu (ATI 5870 with the latest drivers) will stay clocked at the highest clock speed of 850Mhz and memory clock speed of 1200Mhz. Even after closing Firefox 4, the gpu will not down-clock and stay at those highest speed. I've tested the same browsing pattern on IE9 and in which this problem didn't exist so I don't think it's a driver issue. I now have to browse with hardware acceleration turned off to ensure I don't get this problem.

    Ive downgraded from FF4 to 3.6 at this point. The CPU usage is out of control on OS X.

  • Open Sale Order Value (FD33) not getting diminished even after closing SO?

    Hi,
    Upon Executing FD33 and clicking the status view for a Customer say XYZ , and then choosing EXTRAS-Open Sale Order . Say the value of open sale orders being shown is 75000. Even after closing the open sale orders (By Selecting VA05 and Putting reason for Rejection), and then also the Open Sales Order value is not getting diminished.
    What could be the reason ?
    Pls help.
    Regrds,
    Binayak

    Hi Binayak,
    As mentioned by you, running of Credit re-org program 'RVKRED77' is the only solution for this problem and it is known problem in SAP.
    Some precautions
    1. Always run the program in background by scheduling a job.
    2. The idle time is around midnight when no user is working on SAP.
    3. Some time the job fails as some other program may be updating same tables as this program. In such cases re-schedule the job at different time.
    4. You may run the program 'RVKRED88' which will simulate without actual updation of credit values.
    Hope this clarifies..
    Regards,
    Madhu.

  • Locked-up at "Uploading file to Adobe ExportPDF online...", even after closing, exiting, clearing browser cache, clearing all documents from online library.

    Locked-up at "Uploading file to Adobe ExportPDF online...", even after closing, exiting, clearing browser cache, clearing all documents from online library.  Ctrl-Alt-Del EndTask also had no effect.  Upon opening, searches for current status and then locks up...  Any help?

    Any advice would be helpful. Thanks

  • SAPgui.exe is running even after closing the GUI components

    Hello All,
    Even after closing the SAP GUI components like Bex, WAD or RSA1 etc... i am able to see these processes are running under the Task Manager--> Processes....
    even if i try to restart the system, error messages are occuring...saying that SAP is still opend...
    Why it is happening, any ideas?
    Thanks,
    Ravi

    Hi Dirk,
    Thanks for your infomation. Infact, apart from this problem, i have the problem with saving the webtemplate. As it is taking much time to save a template after modifications, i had to terminate the wad process. It seems above 2 problems are related....any ideas?
    Thanks
    ravi
    Message was edited by: Ravi Pasumarty

  • Music continuously plays even after closing the tab which played youtube video, restarting does not help either.

    Music continuously plays even after closing the tab which played youtube video, restarting does not help either.

    please update your version of the flash plugin & see if that works:
    [http://get.adobe.com/flashplayer/] (make sure to uncheck the "McAfee Security Scan Plus" checkbox first if you don't want to install the bundled software)

  • Let addon run even after browser window is closed.

    I want to use this addon - "Pushbullet" even after the browser window is closed. Such an option was available in Chrome when I used it last. I migrated to Firefox recently, and would like to know how to implement the same here.
    Thanks,
    Raj

    FredMcD, You have been here long enough to know there is a "Edit This Post" link on right of your posts as three posts in a row in short order is too much.
    Some Extensions if you can find the chrome url can be used in shortcut to start a Firefox process but only with the Extension running.
    The ChatZilla irc client extension for instance can or at least used to.

  • Image remains after closing window.

    Hi!
    I just purchased my first LCD display (23" Apple) and I immediately noticed an anomaly. When I have a window open, such as mail, after closing, the image of the window remains faintly on the desk top. I can even read the title of the last email etc. The image slowly fades away and disappears but it's somewhat unnerving. An image even remained from the previous user after I switched.
    Is this common? Just a "thing" that LCDs do? After all the hype about xboxes burning in on plasma TVs, I'm a little paranoid.
    Thanks to all for your advice and council !
    Jeff

    Hey Jeff -
    I had a problem with my 23 ghosting a good while back, but I changed the desktop and I haven't noticed it since, I have read of others mentioning the problem, try searching this folder for "ghost".
    This document has some information but from reading posts in the past I suspect the ghosting is partially a hardware issue and some monitors of the same model have it worse than others.
    Patrick

Maybe you are looking for