Tracking down a memory leak in LV8.2 when you can't use the profiler

I am working with this large application. I have satisfied myself that it does have a memory leak by watching the Window's Task Manager while using the app.
My first preference is to use the Profiler. However when I press 'Start' on the profiler, it instantly crashes LV. It does not do this for all VIs. I have tried to find the offending VI as narrowly as possible, but a VI that crashes profiler on one machine doesn't on another, so I gave that path up.
If someone knows of a thread about the profiler crashing, please point me that way.
Failing that, what kind of tips are there for tracking this leak down?
Thanks!

Hiya,
Don't know of anything that will crash the profiler right off-hand, but it never struck me as the most... ah, robust bit of code in LV.
As far as pre-existing tools, you could try the memmon.llb that lives in the National Instruments/<labview>/examples folder.  It should show the memory load of each vi in memory, though it may require a little retooling to get things into a view that you like.
If you're on Windows, there are a number of tricks you can play with the SysInternals (now Microsoft) tools.  This usually boils down to watching lower level accesses to the operating system for patterns that look suspicious.  Not a high yield path, but occasionally it works.
For methods, I like divide and conquer.  The more portions you can eliminate as NOT having the problem, the fewer portions of your code you have left to look for problems in.
Tracking down memory leaks can be very difficult, but most show up in the end.
Good bug hunting!
Joe Z.

Similar Messages

  • Memory leak under GNU/Linux when using exec()

    Hi,
    We detected that our application was taking all the free memory of the computer when we were using intensively and periodically the method exec() to execute some commands of the OS. The OS of the computer is a GNU/Linux based OS.
    So, in order to do some monitoring we decided to wrote a simple program that called exec() infinite number of times, and using the profiler tool of Netbeans we saw a memory leak in the program because the number of surviving generations increased during all the execution time. The classes that have more surviving generations are java.lang.ref.Finalizer, java.io.FileDescriptor and byte[].
    We also decided to test this simple program using Windows, and in that OS we saw that the memory leak disappeared: the number of surviving generations was almost stable.
    I attach you the code of the program.
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    public class testExec
        public static void main(String args[]) throws IOException, InterruptedException
            Runtime runtime = Runtime.getRuntime();
            while (true)
                Process process = null;
                InputStream is = null;
                InputStreamReader isr = null;
                BufferedReader br = null;
                try
                    process = runtime.exec("ls");
                    //process = runtime.exec("cmd /c dir");
                    is = process.getInputStream();
                    isr = new InputStreamReader(is);
                    br = new BufferedReader(isr);
                    String line;
                    while ((line = br.readLine()) != null)
                        System.out.println(line);
                finally
                    process.waitFor();
                    if (is != null)
                        is.close();
                    if (isr != null)
                        isr.close();
                    if (br != null)
                        br.close();
                    if (process != null)
                        process.destroy();
    }¿Is anything wrong with the test program we wrote? (we know that is not usual to call infinite times the command ls/dir, but it's just a test)
    ¿Why do we have a memory leak in Linux but not in Windows?
    I will appreciate any help or ideas. Thanks in advance.

    Hi Joby,
    From our last profiling results, we haven't found yet a proper solution. We think that probably the problem is caused by the byte[]'s/FileInputStreams created by the class UNIXProcess that manage the stdin, stdout and stderr streams. It seems that these byte arrays cannot be removed correctly by the garbage collector and they become bigger and bigger, so at the end they took all the memory of the system.
    We downloaded the last version of OpenJDK 6 (build b19) and modified UNIXProcess.java.linux so when we call its method destroy(), we assign to null those streams. We did that because we wanted to indicate to the garbage collector that these objects could be removed, as we saw that the close() methods doesn't do anything on their implementation.
    public void destroy() {
         // There is a risk that pid will be recycled, causing us to
         // kill the wrong process!  So we only terminate processes
         // that appear to still be running.  Even with this check,
         // there is an unavoidable race condition here, but the window
         // is very small, and OSes try hard to not recycle pids too
         // soon, so this is quite safe.
         synchronized (this) {
             if (!hasExited)
              destroyProcess(pid);
            try {
                stdin_stream.close();
                stdout_stream.close();
                stderr_stream.close();
                // LINES WE ADDED
                stdin_stream = null;
                stdout_stream = null;
                stderr_stream = null;
            } catch (IOException e) {
                // ignore
                e.printStackTrace();
        }But this didn't work at all. We saw that we were able to execute for a long time our application and that the free memory of the system wasn't decreasing as before, but we did some profiling with this custom JVM and the test application and we still see more or less the same behaviour: lots of surviving generations, at some point increase of the used heap to the maximum allowed, and finally the crash of the test app.
    So sadly, we still don't have a solution for that problem. You could try to compile OpenJDK 6, modify it, and try it with your program to see if the last version works for you. Compiling OpenJDK 6 in Linux is quite easy: you just have to download the source and the binaries from here and configure your environment with something like this:
    export ANT_HOME=/opt/apache-ant-1.7.1/
    export ALT_BOOTDIR=/usr/lib/jvm/java-6-sun
    export ALT_OUTPUTDIR=/tmp/openjdk
    export ALT_BINARY_PLUGS_PATH=/opt/openjdk-binary-plugs/
    export ALT_JDK_IMPORT_PATH=/usr/lib/jvm/java-6-sun
    export LD_LIBRARY_PATH=
    export CLASSPATH=
    export JAVA_HOME=
    export LANG=C
    export CC=/usr/bin/gcc-4.3
    export CXX=/usr/bin/g++-4.3Hope it helps Joby :)
    Cheers.

  • I have two iphones, different telcos, i am using the same apple id for both - how can i use the 10GB icloud free memory of my new iphone 5?

    I have two iphones, different telcos, i am using the same apple id for both - how can i use the 10GB icloud free memory of my new iphone 5?

    Thank you KiltedTim!
    YES, that is the free 5GB icloud memory for each apple ID. Can I not add the free 5Gb of my second Iphone to my original apple ID (5GB also) as I want to use one Apple ID name on both 2 Iphones? Is it necessary to have a different apple ID for the second Iphone to avail the free 5GB it carries with it?

  • Issue with turning on project 2010 / 2013 - "There is not enough memory to complete the operation. To free up available memory, close programs, projects, or windows you aren't using, and then try again."

    I get the following error after the installation and configuration window of MS Project: "There is not enough memory to complete the operation. To free up available memory, close programs, projects, or windows you aren't using, and then try again."
    It happens both with MS Project 2010 and 2013 on a Windows 7 desktop. 
    I tried installing / uninstalling Office 2010, MS Project, tried installing 32 and then 64 bit versions, clean up, disk error checker, startup changes (msconfig), anti virus, running as Windows 7 and then Windows XP compatible mode. 
    Nothing helps. I see this issue reported as early as 2007 version of MS projects on Microsoft forums, but I do not see any solution anywhere. Any suggestions on how to fix the issue without having to reformat hard drive? Every other application, including
    all other Office programs work seamlessly. 
    I also tried Microsoft support, after an hour and a half of basically doing what I did before, I was told I have to pay 99$ for "premium" support, so someone can look at this bug. 
    I have 16 Gb RAM and more than 200Gb or hard drive free, so actual memory is not the problem. 

    This issue was originally reported with MS Project 2007 and keeps popping up since.
    A quick Google search provides more than 200K pages of results of this issue:
    https://www.google.ca/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=There+is+not+enough+memory+to+complete+the+operation.+To+free+up+available+memory%2C+close+programs%2C+projects%2C+or+windows+you+aren't+using%2C+and+then+try+again.
    And 193K results on Bing:
    http://www.bing.com/search?q=There+is+not+enough+memory+to+complete+the+operation.+To+free+up+available+memory%2C+close+programs%2C+projects%2C+or+windows+you+aren%27t+using%2C+and+then+try+again.&go=Submit&qs=n&form=QBLH&pq=there+is+not+enough+memory+to+complete+the+operation.+to+free+up+available+memory%2C+close+programs%2C+projects%2C+or+windows+you+aren%27t+using%2C+and+then+try+again.&sc=0-0&sp=-1&sk=&cvid=4cb023c1fbd94ec2bba9821b095f21f2
    Computer was defragged already. I run more tests, and specifically when MS Projects tries to run, it tries to take all memory, more than 300Gb, on the computer. (DropBox was running at the same time, and warned that there were no space. As soon as MS Project
    stopped attempting to configure itself, everything came back to normal and the available space became available again.)
    Looking through older forum posts, looks like this application tries to take "unlimited" amount of memory. Some registry fixes are mentioned potentially, but I was not able to apply them. 
    Since everything else works, this is a MS Project bug reported by multiple users on various versions of Windows, including Vista and 7, so please provide a fix and not 'not a know bug' lie. All the premium support will say, is to format the hard drive, unless
    they have a patch or a registry edit solution. If the latter is true, since the issue exists for multiple years, it should have been already been provided to users.
    Also, I am not running a SQL server, or any server, this is an installation on a local machine. 

  • Calendar on iOS 7. Anyone noticed that when you enter text into the "notes section" of a day, the text disappears behind the keyboard rather than scrolling down to keep pace with text entry ? Looks like an 7 glitch to me ?

    Calendar on iOS 7. Anyone noticed that when you enter text into the "notes section" of a day, the text disappears behind the keyboard rather than scrolling down to keep pace with text entry ? Looks like an 7 glitch to me ?

    Doesn't do that for me. Try resetting the phone

  • My Apple TV 1st gen will now no longer play any of our iTunes music, although it shows a speaker symbol when you select play on the track. Please help?

    My Apple TV 1st gen will now no longer play any of our iTunes music, although it shows a speaker symbol when you select play on the track. Please help?

    Are you streaming or syncing you music? Sounds like you're streaming music directly from iTunes.
    There can be many different issues. First, try power-cycling you wireless router (leave router disconnected for about 1 or 2 minutes) to refresh the wireless communication betweek both devices.
    Make sure all software updates have been installed, for Apple TV and iTunes.

  • I have my iPhoto set to an external drive yesterday when it was in use the usb disconnected i now have a message saying (your photo library is either in use by another application or has become unreadable) I have tried shutting down and restarting.

    I have my iPhoto set to an external drive, when it was in use the usb disconected as i was moving my mac air, when i re-conected a message said (your photo library is either in use by another application or has become unreadable).
    I have tried shutting it down and then re opening iPhoto but get the same message.
    The reason for the external drive was there was not enough room on my hard drive, I have around 7000 photos on it.
    is there a simple fix?
    Regards
    Dale

    These are your options:
    1. Restore the iPhoto library from the most recent backup that predates the issue.
              Advantages: Always works, if library damage is causing the problem and the backup is intact.
              Disadvantages: Impossible if you don't have a backup. All changes made since the backup are lost.
    2. Repair or rebuild the library. Be sure to back it up first.
              Advantages: May solve the problem with no loss of data.
              Disadvantages: May fail. May take a long time if the library is large.
    3. Scavenge the library with a third-party application called "iPhoto Library Manager," which you can find in a web search. From the application's menu bar (not the iPhoto menu bar), select Library ▹ Rebuild.
              Advantages: All images and albums should be preserved.
              Disadvantages: All books, calendars, and slideshows will be lost.

  • Can I use the volume sliders after adding automation to tracks?

    After adding a whole bunch of automation to pretty much every track on my first real project on GarageBand, I started trying to mix, and it seems the volume sliders are all locked up on the tracks with automation. I really don't want to have to add a million more automation points just to mix the song properly, so if anyone has a solution, that would be greatly appreciated!
    Thanks!

    Can I use the volume sliders after adding automation to tracks?
    no
    if anyone has a solution
    you can select all the points by clicking in the header, and then drag them, though

  • Why am I recently unable to use my mouse to scroll email topics or content?  I can only use the up and down arrows keys to scroll.

    Why am I recently unable to use my mouse to scroll email topics or content?  I can only use the up and down arrows keys to scroll. I am able to use my mouse to scroll through internet searches.  It only seems to have affected my email messages.

    Try a restart.
    Do a backup, using either Time Machine or a cloning program, to ensure files/data can be recovered. Two backups are better than one.
    Try setting up another admin user account to see if the same problem continues. If Back-to-My Mac is selected in System Preferences, the Guest account will not work. The intent is to see if it is specific to one account or a system wide problem. This account can be deleted later.
    Isolating an issue by using another user account
    If the problem is still there, try booting into the Safe Mode using your normal account.  Disconnect all peripherals except those needed for the test. Shut down the computer and then power it back up after waiting 10 seconds. Immediately after hearing the startup chime, hold down the shift key and continue to hold it until the gray Apple icon and a progress bar appear. The boot up is significantly slower than normal. This will reset some caches, forces a directory check, and disables all startup and login items, among other things. When you reboot normally, the initial reboot may be slower than normal. If the system operates normally, there may be 3rd party applications which are causing a problem. Try deleting/disabling the third party applications after a restart by using the application un-installer. For each disable/delete, you will need to restart if you don't do them all at once.
    Safe Mode - Mavericks
    Safe Mode - About

  • How can I use the up & down arrows within a split screen email?

    When I'm reading a split screen email (in Yahoo), I have to use the scroll bar to go up and down WITHIN the email. I would like to set it up so that I can use the arrow keys to scroll up and down the email content. Thanks.

    Click once in the split-side where you want to use the scroll arrows, to make the "focus" there.

  • Now that I upgraded to Maverick on my Mac air, I can not use the power button to shut down the computer anymore. any suggestions?

    Now that I upgraded to Maverick on my Mac air, I can not use the power button to shut down the computer anymore. I now have to go to the apple icon in the upper left corner.  Any short cuts instead of going to the apple in the top left corner and hitting shut down.  Doing that all the time, I feel like I am back at work using a "Windows" computer.

    This a is tricky one, but you can still do it. Instead of pressing the power button, hold it down for a few seconds and then you'll see the shut down options dialog pop up.
    I guess they were trying to prevent accidental touching of that button. They did something similar with the Eject button a few versions ago, where you have to hold down Eject instead of just tapping it so that you don't pop out a CD by mistake.

  • Memory Leak in Preview.app when switching Display Profiles

    I found a weird memory leak in Max OS X Preview.app, which manifests itself when Display profiles (color calbration) is change. I wonder if anyone else can reproduce my experience.
    1. Open up "System Preferences" -> "Displays", switch to the "Color" tab. You'll need at least 2 available profiles in the list. (If you only have 1, you can create another using "Calibrate..." button to launch Display Calibration Assistant.
    2. Open an image file in Preview.app.  The larger, the better. Zoom in full size to maximize the effect of the bug. I repro'ed easily with this image: http://www.donporter.net/NewSchool/Color/Examples/Printer%20Test%20file.jpg
    3. Open up "Activity Monitor.app", and click on Preview to highlight it, so you can watch its memory usage.
    4. Switch back to "Diplays" Preference Pane. Using the arrow keys, toggle up and down between two different Display profiles.
    4a. At the same time, watch Preview's "Real Mem" in Activity Monitor, as well as the total "Active" memory.
    5. Each time you switch profiles,  Preview consumes more Active/Real memory, about 25MB per switch in my case. This continues until all physical memory is consumed, and then (I presume) starts swapping virtual memory to disk.
    6. Bring Preview to  foreground, and all the profile-induced memory usage is freed.
    Weird, wild stuff.

    Could it be possible that this is just the OS holding the memory for the app until another process requires it?  Do you find that the memory increase eventually causes the app to become unstable? 
    It might be best to open a new bug report on this over at bugbase.adobe.com.  When adding the bug, please include any source code, project or installer that will help us reproduce the issue internally.  If you'd like to keep your code private, feel free to email it directly to [email protected]  Once entered, please post back with the URL so that others effected can add their comments and votes.
    Thanks,
    Chris

  • Memory Leak on General Block when using Java Script

    Hi,
    I have a web view, that runs a html within the html there is a javascript which has a third party object this object displays some data and grows dynamically every time I invoke this object to grow I see in Instrument monitor whole bunch of Generalblock-256 ( 256 Bytes ) memory leak, I was wondering how can I manage this memory, I know in java script if we assign null to an object java will release it, but it's already reported the leak before I assign the object to null.
    Is there any way I can use let's say by NSAutoReleasePool.
    Thanks.

    The Memory leak is pretty much gone, with new release of OS 2.2.1 as apple has done better memory management for safari.

  • Firefox is using large amounts of CPU time and disk access, and I need to know how to shut down most of this so I can actually use the browser.

    Firefox is a very busy piece of software. It's using large amounts of CPU time and disk access. It puts my usage at low priority, so I have to wait for some time to be able to use my pointer or keyboard. I don't know what it uses all that CPU and disk access time for, but it's of no use to me. It often takes off with massive use of resources when I'm not doing anything, and I may not have use of my pointer for several minutes. How can I shut down most of this so I can use the browser to get my work done. I just want to use the web site access part of the software, and drop all the extra. I don't want Firefox to be able to recover after a crash. I just want to browse with a minimum of interference from Firefox. I would think that this is the most commonly asked question.

    Firefox consumes a lot of CPU resources
    * https://support.mozilla.com/en-US/kb/Firefox%20consumes%20a%20lot%20of%20CPU%20resources
    High memory usage
    * https://support.mozilla.com/en-US/kb/High%20memory%20usage
    Check and tell if its working.

  • Track ID keeps opening when watching a movie using the noise cancelling headset

    When I am trying to watch a movie using the noise cancelling headset, the Track ID app keeps opening/starting and tries to identify the "track" I am listening to.  I stop the recording and close the Track ID app down but it immediately opens again and this happens multiple times in a row.  It stops after 10 or so attemtps and seems ok for a while but will do this again 5-10 minutes later.  This also happened when I was listening to a 3rd party app which plays relaxing sounds.  It seems to happen more often when there is loud background noise (on the train and someone opened the window), but Track ID has opened with out me starting it with very littel background noise...  It is very annoying when you are trying to watch a movie or downloaded TV show etc.  

    Hi and welcome to the community! Since you're new please be sure that you have checked out our Discussion guidelines.
    If this is only happening when you have a specific accessory attached, please try this: Main Menu > Settings > Apps > Smartconnect > Clear Data.
    What are your thoughts about this forum? Let us know by doing this short survey.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

Maybe you are looking for

  • Idoc-xi-file scenario.  how to display file in html format

    I am not sure whether this is a valid question.........but want to confirm as it was asked by somebody In idoc-xi-file scenario.......  how to display file in html format ?? Thanks in advance Kumar

  • Droid Razr - too hot to touch

    Having several issues with my Droid RAZR, purchased in June 2012.  Current Android Version 4.1.2, Build Nbr 9.8.20-72.... Main issues are: Battery life - stays plugged in all day & takes about an hour to go from 100% battery to about 65% battery.  It

  • Streaming music thro Nokia's FM Transmit facility

    I have a problem connecting any streaming music to my Car radio, Although it support Bluetooth connectivity for my Phone calls ..it wont connect streaming due to the lack of A2DP software.. This seems to be a common problems as I have dicovered throu

  • Can't turn file vault off

    file vault won't turn off says it doesn't have enough memory anyone know how i can turn it off w/o deleting files? i have 80 GB HD w/ 20 GB available and 100 GB backup external HD which I backup my HD with using SuperDuper.

  • HT201210 i cant restore my ipad mini...7.0.2...

    my ipadmini was disable...bcause my brother...put a wrong codes several time... now i cant restore it... i try the DFU mode...i click the restore ipad... but after that...when finish downloading when i click restore...it say the file was currupt, try