Program runs fine then takes a long time to close

Hi Everyone,
I have written a mid sized application, which is running fine until it comes to closing, then it takes an age to close. If it has only been running for a short time it closes fine, but after some time running it takes longer and longer to close. Until you try to close, it remains fully responsive and performing well.
I have heard the phrase 'memory leak' banded around, but am not 100% sure how I would have created one of these. I am also looking into my queues accidentally getting too big.
If you had this a problem like this, where would you look first?
I could do with some advice around common places that this kind of thing happens.
I don't really want to post my whole application on here, but it includes:
Multiple loop event based producer consumer
Camera acquisisition and image processing
DAQ for some simple digital I/O
Reading and writing to text and image files
Error handling
Compiled as an executable
No local variable abuse
Any advice would be appreciated.
Thanks.

Any building of arrays?  If those get large, the application can start to get sluggish.
P@Anand is probably on the right track.  Make sure you check your closing operations and make sure a loop isn't left sitting there for a long time.
I have also seen file handling take a lot of time to delete temporary files or close large files.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Firefox takes a long time to close since a recent update and hogs memory.

    Since one of the recent updates that started using plugin containers, Firefox takes a long time to close. If I try to go back it, it tells me it is still running. I liik in Task Manager and about seven plug-in container. exe's are running and I have turned off or disabled mostplugins and addons, even Quicktime. Firefox uses an obscene amount of RAM on my XP machine and has made it sluggish. I use XP SP3. This started after you added the plugin containers in one of the recent updates earlier in the year. For the features it offers me or doesn't offer me, rather, it uses way too much RAM and is too sluggish. And takes a very long time to close out when I close the browser. It uses about twice as much RAM as it used to.

    Use "Firefox/File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit") to close Firefox if you are currently doing that by clicking the close X on the title bar.
    See "Hang at exit":
    *http://kb.mozillazine.org/Firefox_hangs
    See "Firefox hangs when you quit it":
    *https://support.mozilla.org/kb/Firefox+hangs
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    *https://support.mozilla.org/kb/Troubleshooting+plugins

  • Portege R100: FDISK and HDD format takes very long time

    I have Portege R100 and when I tried to run FDISK it take very long time to Create a DOS partion.
    After running FDISK I tried to do FORMAT the HD and is taking more than 6 hours to Format hard drive.
    After Format I tried to Load Win XP but it system just hanged with message Loading files...
    Could some one hep me out

    it's a known problem that FDisk cannot cope with the 1.8" hd in your R100
    Use the method described in this thread and you will succeed :
    http://forums.computers.toshiba-europe.com/forums/thread.jspa?threadID=19232

  • My mac takes a long time to log on, running slow

    my imac is running slow & takes a long time logging on, anyone knows why this happens?

    If you have more than ten or so files or folders on your Desktop, move them, temporarily at least, somewhere else in your home folder.
    Disconnect all wired peripherals except keyboard, mouse, and monitor, if applicable. Launch the usual set of applications you use when you notice the problem.
    Step 1
    Launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Activity Monitor in the page that opens.
    Select the CPU tab.
    Select All Processes from the menu in the toolbar, if not already selected.
    Click the heading of the % CPU column in the process table to sort the entries by CPU usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Also post the values for % User, % System, and % Idle at the bottom of the window.
    Select the System Memory tab. What values are shown in the bottom part of the window for Page outs and Swap used?
    Step 2
    Launch the Console application in the same way as above, and select “kernel.log” from the file list. Post the dozen or so most recent messages in the log — the text, please, not a screenshot.
    If there are runs of repeated messages, post only one example of each. Do not post many repetitions of the same message.

  • Macbook Pro takes a long time (41 secs) from start to reach log-in - It used to be almost instantaneous, I'm running Lion OS

    My Macbook Pro takes a long time (41 secs) from start to reach log-in - It used to be almost instantaneous, I'm running Lion OS. I thought this might be because I'd used a lot of disk space but I've now reduced that - I'm only using 40 of the 320 gb available. I have no games and I've unchecked the "re-open windows" option on shutdown. The rest of the preformance (once in) remains good.

    41 seconds is actually a little faster then normal. Boot from completely off is normally around 45-50 seconds.
    Your computer never ever came on almost instantaneously from completely off. You are confusing waking up from sleep mode and booting the computer from completely off.

  • When a process flow activity takes a long time to run.

    Hello,
    I have a process flow activity that sometimes takes a long time to run so that the process flow never ends. Is it possible that I can set the activity so that during a certain time that this has not been executed automatically flow process to continue?
    I'm Using Oracle Warehouse Builder 11g on Windows Server 2003 R1.
    Greetings and thanks.

    What I've done in the past is just use a small polling procedure (PL/SQL) and a conditional transition in the process flow, depending on what the proc returns (Continue or Fail) then the flow of control in the Process is changed.
    I think the key also is to not have too much paralellism going on too, that way it's easy to streamline the PF and remove slow moving processes to a more linear path (stopping bottle necks on your logical AND).
    Edited by: NSNO on Apr 29, 2010 2:31 PM

  • Netflix, HBO Go, ABC Tv app on my apple tv take a long time to download my videos and they are choppy, how can I resolve this issue? My apple TV is running off of WiFi in my apartment.

    Netflix, HBO Go, ABC TV along with other apple TV apps, take a very long time to download the video and they are choppy when running. My apple TV runs off of WiFi in my apartment. When trying to download updates, it take a long time and then a video screen with "This Update was not Successful. Apple TV couldn't be downloaded at this time. Try again later." What can I do to resolve this issue? I purchased this apple TV in May 2013 new.

    That will be an issue with the network
    What is your current connection via speedtest.net?
    Make sure DNS is set to auto (settings - general -network)
    Since you are in an apartment the local wifi network is more prone to interference, try ethernet

  • My mac air died, after i reinstall from dvd drive, when i boot up again, i saw a prohibit sign showing up on the screen, then get to my logon screen.  After logon, it takes very long time to load any application.  pls help

    my mac air died, after i reinstall from dvd drive, when i boot up again, i saw a prohibit sign showing up on the screen, then get to my logon screen.  After logon, it takes very long time to load any application.  pls help

    OK. If you believe that.
    When the disk is starting to die it can be bad for a moment and then be good for a while. If there was no problem while you were checking it of course it shows up good.
    I tell you those are the signs of a disk that is about to die.
    Allan

  • Snow Leopard 10.6.2 takes a long time to run 'X11.app' (with system log)

    Hello everyone, English is not my mother tongue so may not be exactly correct, sorry about that.
    Background:
    I have a MacBook White (13-inch, Mid 2009) that isn't unibody, and was running Leopard 10.5.
    I did a clean installation and now Snow Leopard 10.6.2, with iLife, iWork, and many many apps.
    I am the only one who will use the Mac and my user account is as the 'admin'.
    I previously had a problem concerning X11 too:
    http://discussions.apple.com/thread.jspa?threadID=2343732
    *What I've done:*
    (1) rename my HD to 'Michaels_Home' under 'Get Info' from Finder (I can't rename in Disk Utility though)
    (2) press return (enter)
    (3) change my home folder path to the '/Volumes/Michaels_Home/Users/Michael' (http://eshop.macsales.com/Reviews/Framework.cfm?page=Tips/relocate3/relocate3.ht ml)
    (4) restart
    (5) log in and open X11
    (6) problem solved!!
    ==========
    *BUT NOW* I have a problem after:
    (1) log in as the root user, and use command +ditto -V xyz xyz+ to copy my home folder from '/Volumes/Michaels_Home/Users/Michael' to '/Users>Michael'
    (2) change my home folder path to the '/Users/Michael' (http://eshop.macsales.com/Reviews/Framework.cfm?page=Tips/relocate3/relocate3.ht ml)
    (3) use the Mac OS X Snow Leopard USD$29 disc to boot my Mac up
    (4) delete the 'Michaels_Home' partition (I had 3 partitions: (1) Macintosh HD (2) Michaels_Home (3) Windows XP Professional)
    (5) resize the 'Macintosh HD' partition
    (6) boot from Macintosh HD
    (7) find that there's a problem about X11
    _The problem:_
    it takes a *long time* for X11 to start.
    When I try to open the 'X11.app', the X11 icon begins jumping on the Dock, but nothing happens.
    Jumping and jumping... finally, it doesn't jump any more, with just the X11 icon on the dock.
    What's more, there is no white dot under the icon, which means the app isn't running at the moment.
    I right-clicked the icon, it shows me 'application not responding'.
    So, I open the *Activity Monitor*, and I can see there are 3 apps related to X11 are running:
    (1) X11
    (2) X11.bin
    (3) xauth
    *At the moment now, if you would wait for about 1.5 min., X11 will open.*
    Please see below for the system log (from 'FREEZING' to 'WORKING')
    ==========
    Mar 1 00:42:10 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: main(): argc=2
    Mar 1 00:42:10 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[0] = /Applications/Utilities/X11.app/Contents/MacOS/X11.bin
    Mar 1 00:42:10 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[1] = -psn0139298
    Mar 1 00:42:10 n219073058253 [0x0-0x22022].org.x.X11[327]: Waiting for startup parameters via Mach IPC.
    Mar 1 00:42:10 n219073058253 org.x.startx[335]: font_cache: Scanning user font directories to generate X11 font caches
    Mar 1 00:42:10 n219073058253 org.x.startx[335]: font_cache: Updating FC cache
    Mar 1 00:42:10 n219073058253 org.x.privileged_startx[344]: font_cache: Scanning system font directories to generate X11 font caches
    Mar 1 00:42:10 n219073058253 defaults[370]: \nThe domain/default pair of (org.x.X11, dpi) does not exist
    Mar 1 00:42:12 n219073058253 org.x.privileged_startx[344]: font_cache: Updating FC cache
    Mar 1 00:42:13 n219073058253 org.x.startx[335]: font_cache: Done
    Mar 1 00:42:14 n219073058253 org.x.privileged_startx[344]: font_cache: Done
    Mar 1 00:42:31 n219073058253 org.x.startx[335]: xauth: timeout in locking authority file /Users/Michael/.serverauth.335
    Mar 1 00:42:51 n219073058253 org.x.startx[335]: xauth: timeout in locking authority file /Users/Michael/.Xauthority
    Mar 1 00:43:31: --- last message repeated 1 time ---
    Mar 1 00:43:31 n219073058253 org.x.startx[335]: xauth: timeout in locking authority file /Users/Michael/.Xauthority
    Mar 1 00:43:51: --- last message repeated 1 time ---
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: Listening on socket for fd handoff: (4) /var/tmp/tmp.0.9OYerf
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: Thread created for handoff. Returning success to tell caller to connect and push the fd.
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: Received new $DISPLAY fd: 6 ... sleeping to allow xinitrc to catchup.
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: dostart_x11server(): argc=6
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[0] = /usr/X11/bin/X
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[1] =
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[2] = -nolisten
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[3] = tcp
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[4] = -auth
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[5] = /Users/Michael/.serverauth.335
    Mar 1 00:43:51 n219073058253 org.x.startx[335]: Xquartz: Handoff connection established (try 1 of 5) on fd 6, "/var/tmp/tmp.0.9OYerf". Sending message.
    Mar 1 00:43:51 n219073058253 org.x.startx[335]: Xquartz: Message sent. Closing handoff fd.
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: Xquartz starting:
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X.Org X Server 1.4.2-apple45
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: Build Date: 20090705
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: (EE) XKB: Couldn't open rules file /usr/X11/share/X11/xkb/rules/base
    Mar 1 00:43:54: --- last message repeated 1 time ---
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app Handing off fd to server thread via DarwinListenOnOpenFD(6)
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: DarwinListenOnOpenFD: 6
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: Calling ListenOnOpenFD() for new fd: 6
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: Launching /usr/X11/bin/xterm:
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[0] = /bin/sh
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[1] = -c
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[2] = /usr/X11/bin/xterm
    ==========
    I quit the X11:
    ==========
    Mar 1 00:45:45 n219073058253 [0x0-0x22022].org.x.X11[327]: Quitting Xquartz...
    Mar 1 00:45:45 n219073058253 org.x.startx[335]: /usr/X11/bin/xinit: connection to X server lost.
    Mar 1 00:45:45 n219073058253 org.x.startx[335]: waiting for X server to shut down
    ==========
    AFTER quitting X11, I can see something related X11 is stilling running:
    ==========
    Mar 1 00:46:06 n219073058253 org.x.startx[335]: xauth: timeout in locking authority file /Users/Michael/.Xauthority
    ==========
    So what actually causes this problem?
    Thanks in advance!

    It turns out that there's something wrong about permissions.
    Here's the fix:
    (1) log in as the +root user+
    (2) type +chown -R Michael:staff ~Michael+
    (3) log out the +root user+
    (4) log in your account
    (5) done!
    Hope this thread will help those who encounter the same problem as me!

  • HT1222 I would like to be able to delete more then just one email at a time. I get a lot of mail that needs deleted and takes a long time to do. Would like to do 10 email deletes at a time on my iPad. Can you help me.

    I would like to be able to delete more then just one email at a time. I get a lot of mail that needs deleted and takes a long time to do. Would like to do 10 email deletes at a time on my iPad. Can you help me.

    open inbox
    tap Edit on top right of list.
    tap each email to check it off.  Then tap trash.   then 'trash selected mesages"
    done

  • My final cut is running extremely slow after having for 6 months.  I use external hard drives and save nothing on my computer.  it takes a long time to render now. do you think something is wrong with computer. took it to mac store but they fail to help

    my final cut is running extremely slow after having for 6 months.  I use external hard drives and save nothing on my computer.  it takes a long time to render now. do you think something is wrong with computer. took it to mac store but they fail to help me.  I have a 13 inch mac book pro 10.6.8 8gb 2.3 gfz intel core i5

    What did Apple tell you about what they did (or did not) find here?
    See if working on the main disk is any faster.
    USB2 is glacial, as I/O interconnects go.  And USB2 disks have been known to fail, or sometimes to drop back to USB1 speeds, too.  FireWire 800 is substantially faster than USB2, but still not as fast as the internal drive connections can provide.
    Put another way, start varying your configuration, and see which configuration changes (still) have the problem, and which don't.

  • My folders take forever to open and then the docs within take a long time for the icon to pop up. the same thing with moving itmes from the desktop to a folder, and also emptying the trashh

    my folders take forever to open and then the docs within take a long time for the icon to pop up. the same thing with moving itmes from the desktop to a folder, and also emptying the trashh

    Don't know if that would be a failing hard drive, but it may be that you are out of available space. How much hard drive space do you have available? Please highlight the Macintosh HD icon and then press Command and I for a get info window. Once open, please copy and post the following:
    Capacity:
    Used:
    Available:
    Mac OS requires a minimum of 10 - 15% of total hard drive space available and empty at all times in order to operate properly.

  • On an pci_mio 16e4 programming using nidaq & visual basic, after using AI_Setup analog sequential data accusition stops.To restart I use Init_DA_Brds This takes a long time, What must I reset to restore the analog sequential function?

    on an pci_mio 16e4 programming using nidaq & visual basic, after using AI_Setup analog sequential data accusition stops.To restart I use Init_DA_Brds This takes a long time, What must I reset to restore the analog sequential function?
    I belive that the trigger is being changed on the io board, but cannot manage to reset it.
    The reset process takes in the order of 0.1 sec, and since this is a time critical application, i want to get the scanning function working again faster

    Dear Ian. Thank you for your reply. The problem appears to be that the scan trigger(s) are stopped, or something, by the use of the AI_setup instruction. The sytstem works perfectly until this instruction is used. My problem is in understanding what has happened since the help seems to give no detail on any interconnection between the scan system and the external analog trigger system. I have tried to reconnect the triggers, but so far unsucessfuly

  • Firefox is running slow, sluggishly, websites take a long time to load, to connect. I've done everything this board has suggested.

    Firefox is really starting to annoy me. Sometimes it runs slow and sluggishly, other times it doesn't. Usually it does though. When I open new tabs, the connection icon will just keep swirling. I constantly get High CPU Useage alerts from my virus protection. I've done everything listed in the below articles. Does anyone have some advice? Firefox didn't use to be like this.
    Thank you.
    https://support.mozilla.org/en-US/questions/864739?as=aaq
    https://support.mozilla.org/en-US/questions/882138#answer-256718

    Alright, it's getting to the point where I can barely use FireFox anymore. It's getting worse by the day, I don't understand. Web pages take a LONG time to load, but sometimes they don't....it's hit or miss. But when they do take a long time, they take a long time.
    It's getting very bad. I don't know much about computers, safe mode, and all that. It would really help if someone could walk me through what to do, like they would a 10-year old... actually a 10-year old probably knows more than me. Well you get the idea.
    I really want to keep using this browser, but if I don't get it fixed I will have to stop. Like I said in the initial post, I've done all the things those two links suggested. It got better at first, but now it seems like it's gotten worse.

  • When I click Add Bookmark the bookmark window takes a long time showing up and then starts appearing and disappearing.

    I click on Bookmarks in the Menu Bar. Then I scroll to Add Bookmark and click on that. Normally a Window appears allowing me to select where I want the new bookmark saved. Now this window takes a long time to appear if it ever does (sometimes I get tired of waiting). Then when I attempt to put my cursor arrow somewhere in this window, the window disappears. Then it starts appearing and disappearing when I move my cursor around.

    That is a problem with an AVG extension or toolbar (tavgp)
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for