Memory leak with Power Spectrum function

Hi
I have a memory leak on my application. By observing with the "Desktop Execution Trace Toolkit", the Power Spectrum function (from NI_AALPro.lvlib) seems to have two "Reference leak".
The first one refers to the function "Open VI reference"; I got around this problem by replacing the "Open VI reference" by an "Initialize" input boolean, but I don't understand the second memory leak.
Any idea ?
Thanks...
(See attachments : Desktop Execution Trace + code)
LV8.6.1 + Desktop Execution Trace Toolkit 2009
Same problem with LV2012 + Desktop Execution Trace Toolkit 2012
Attachments:
DesktopExecutionTraceToolkit.png ‏82 KB
MemoryLeakPowerSpectrum.zip ‏7 KB

Hi Mathilde,
Thank you for using NI Discussion Forums!
I reproduce this problem with LV2012 + Desktop Execution Trace Toolkit 2012. I will look further into this.
Are there many calls of this function in your code? Could it be a problem for you?
Thank you.
Regards,
Audrey_P
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
Journées techniques : des fondamentaux aux dernières technologies pour la mesure et le contrôle/comm...

Similar Messages

  • Memory leak with callback function

    Hi,
    I am fairly new to LabWindows and the ninetv library, i have mostly been working with LabVIEW.
    I am trying to create a basic (no GUI) c++ client that sets up subscriptions to several network variables publishing DAQ data from a PXI.
    The data for each variable is sent in a cluster and contains various datatypes along with a large int16 2D array for the data acquired(average array size is 100k in total, and the average time between data sent is 10ms). I have on average 10 of these DAQ variables.
    I am passing the same callback function as an arguement to all of these subscriptions(CNVCreateSubcription).
    It reads all the correct data, but i have one problem which is that i am experiencing a memory leak in the callback function that i pass to the CNVCreateSubscription.
    I have reduced the code one by one line and found the function that actually causes the memory leak, which is a CNVGetStructFields(). At this point in the program the data has still not been passed to the clients variables.
    This is a simplified version of the callback function, where i just unpack the cluster and get the data (only showing from one field in the cluster in the example, also not showing the decleration).
    The function is passed into to the subscribe function, like so:
    static void CNVCALLBACK SubscriberCallback(void * handle, CNVData data, void * callbackData);
    CNVCreateSubscriber (url.c_str(), SubscriberCallback, NULL, 0, CNVWaitForever, 0 , &subscriber);
    static void CNVCALLBACK SubscriberCallback(void * handle, CNVData data, void * callbackData)
    int16_t daqValue[100000];
    long unsigned int nDims;
    long unsigned int daqDims[2];
    CNVData fields[1];
    CNVDataType type;
    unsigned short int numFields;
    CNVGetDataType(data, &type, &nDims);
    CNVGetNumberOfStructFields (data, &numFields);
    CNVGetStructFields (data, fields, numFields); // <-------HERE IS THE PROBLEM, i can comment out the code after this point and it still causes a memory leak.
    CNVGetDataType(fields[0], &type, &nDims);
    CNVGetArrayDataDimensions(fields[0], nDims, acqDims);
    CNVGetArrayDataValue(fields[0], type, daqValue, daqDims[0]*daqDims[1]);
    CNVDisposeData(data);
    At the average settings i use all my systems memory (4GB) within one hour. 
    My question is, have any else experienced this and what could the problem/solution to this be?
    Thanks.
    Solved!
    Go to Solution.

    Of course.....if it is something i hate more than mistakes, it is obvious mistakes.
    Thank you for pointing it out, now everything works

  • Memory leak in Gabor spectrogram function?

    HI,
    Is anyone aware of a memory leak in the SptRealFastGaborSpectrogramEx function of the signal processing toolkit? I have version 7.0.1.  I have debugged everything else and cannot seem to find anything in my code.  
    Thanks!
    Marc

    Marc,
    I responded VIA email but I will also discuss this here.
    Since you are using a C++ environment, there may be problems with calling these functions (though technically they should work). I am unable to replicate this issue in CVI (what this toolkit is made for) however, could you try to use the non-Ex version of this function? If this still does not work, please email me a small example of this behavior in a small project and I can try to see if we can locate the problem.
    Brandon Vasquez | Software Engineer | Integration Services | National Instruments

  • Memory leaks with Third party classes

    Hello all,
    This is fairly known problem. But I guess, my problem gives a new dimention to the problem.
    I have an application which is developed by me. This application ideally needed to use third party classes ( obviously no source code is supplied ). These third party classes provide extra functionality required.
    The problem is, when I don't use third party classes in my application, every thing is fine. When I include third party classes, I am having memory leaks.
    Then I tried to investigate memory leaks with Optimizeit tool. It is new to me. As of now, I understood, we can identify where the memory leaks are occuring.
    finally the problem is, in order to solve this, I need some patches in the code. But I don't have source code for those classes. How to solve this problem?
    For example,
    I use a third party classes in my code like this,
    ThirdPartyMemoryLeakClass obj = new ThirdPartyMemoryLeakClass();
    This 'obj' is made static, as it takes lot of time to create this object. Obviously this object contains several references to other objects, which I can't control.
    In the process of reusing this object, I am getting memory leaks.
    Any ideas regarding, how one has to deal this type of situations? What are the issues involved with this case? Are there any similar problems, which have been solved? are most welcome.
    many thanks for your time.
    Madhav

    Decompile it using jad. Find leak.Yes, I too got the idea and tried to decompile those classes and recompile. I had some problems while recompiling. Is this is the only way to get rid of this problem?
    I was refering to powersoft.datawindow.DataStore class. Does any body here has worked on these?
    Can you suggest me how to find the memory leak causes? if you were needed to find out memory leak causes, what would be your approach?
    Madhav

  • Memory leak with 1.6.0_07 in applet using Swing

    Java Plug-in 1.6.0_07
    Using JRE version 1.6.0_07 Java HotSpot(TM) Client VM
    Windows XP - SP2
    I have a commercial application that has developed a memory leak with the introduction of the latest plugin. The applets chew up memory and eventually freeze. They did not before. Using jvisualm I see a build up of native arrays, primarily int[][] and char[]. I'm still investigating. Anyone have a similar experience?
    The Applet uses a swing interface, uses buffered images and swing timers, and regularly performs http connections to the server which result in actions via the SwingUtil.invokeLater() method.

    I am Using Internet Explorer Browser Version 6.0.Huge security hole.
    Its not throwing Error / Exception Wrap a try/catch at the highest level possible.
    Catch 'Throwable'. And log/display it somewhere.

  • Memory leak with UI automation

    Hi, 
    I noticed there is memory leak with UI automation in my window 8.1.
    I noticed there is solution for window 8
    http://support.microsoft.com/kb/2885482
    Is there any solution for window 8.1?
    I really appreciate for any help.

    Hi,
    I'm sorry for didn't hear anything about this issue. I'll try to connect the writer of this KB, hope we can find some suggestion. If there is any progress about this problem, I would come back.
    Roger Lu
    TechNet Community Support

  • Memory Leak with JPopupMenu

    It seems there is a memory leak with JPopupMenu. The following program demonstrates this leak. If you run the program, click on show form, and then close the form, the used memory will be GCd appropriately. If you click on show form, then right click on the table to show the popup (even if you dont do anything else with the popup) then close the form, it never GCs the form. I've tried all kinds of crazy things, but I cant seem to find what is keeping the memory from being GCd.
    Peter
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowEvent;
    import java.awt.event.WindowListener;
    import java.beans.PropertyChangeListener;
    import java.text.DecimalFormat;
    import java.util.Timer;
    import java.util.TimerTask;
    import java.util.Vector;
    import javax.swing.AbstractAction;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JPopupMenu;
    import javax.swing.JRadioButtonMenuItem;
    import javax.swing.JScrollPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTable;
    import javax.swing.SwingUtilities;
    import javax.swing.table.AbstractTableModel;
    @SuppressWarnings("serial")
    public class TriState extends JPanel {
         private static final long               K               = 1024;
         private static final long               M               = K * K;
         private static final long               G               = M * K;
         private static final long               T               = G * K;
         protected static int ctr = 1;
         private JButton                              btnShow          = new JButton("Show Form");
         private JLabel                              lblMem          = new JLabel();
         private static final DecimalFormat     df               = new DecimalFormat("#,##0.#");
         protected Timer                              updateTimer     = new Timer();
         public TriState() {
              this.setLayout(new GridLayout());
              add(btnShow);
              add(lblMem);
              updateTimer.scheduleAtFixedRate(new UpdateTimerTask(), 1000, 1000);
              btnShow.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                        FrmReferrals fr = new FrmReferrals();
                        fr.setVisible(true);
         class UpdateTimerTask extends TimerTask {
              public void run() {
                   SwingUtilities.invokeLater(new Runnable() {
                        @Override
                        public void run() {
                             dumpMemoryUsage();
         protected void dumpMemoryUsage() {
              System.gc();
              Long t = Runtime.getRuntime().totalMemory();
              long f = Runtime.getRuntime().freeMemory();
              String st = convertToStringRepresentation(t);
              String sf = convertToStringRepresentation(f);
              String su = convertToStringRepresentation(t - f);
              System.out.println("Total:" + st + "(" + t + ") Free:" + sf + "(" + f + ") Used:" + su + "(" + (t - f) + ")");
              lblMem.setText(su + "/" + st);
         public static String convertToStringRepresentation(final long value) {
              final long[] dividers = new long[]{T, G, M, K, 1};
              final String[] units = new String[]{"TB", "GB", "MB", "KB", "B"};
              if (value < 1)
                   throw new IllegalArgumentException("Invalid file size: " + value);
              String result = null;
              for (int i = 0; i < dividers.length; i++) {
                   final long divider = dividers;
                   if (value >= divider) {
                        final double dr = divider > 1 ? (double) value / (double) divider : (double) value;
                        result = df.format(dr) + units[i];
                        break;
              return result;
         private static void createAndShowGUI() {
              JFrame frame = new JFrame("SimpleTableDemo");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              // Create and set up the content pane.
              TriState newContentPane = new TriState();
              newContentPane.setOpaque(true); // content panes must be opaque
              frame.setContentPane(newContentPane);
              // Display the window.
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              javax.swing.SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        createAndShowGUI();
         protected class PopupMenu extends JPopupMenu {
              public PopupMenu() {
                   JRadioButtonMenuItem item1 = new JRadioButtonMenuItem(new AbstractAction("Insert Item") {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                             System.out.println(e.getActionCommand());
                   item1.setActionCommand("Insert");
                   add(item1);
                   JRadioButtonMenuItem item2 = new JRadioButtonMenuItem(new AbstractAction("Delete Item") {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                             System.out.println(e.getActionCommand());
                   item2.setActionCommand("Delete");
                   add(item2);
         public class FrmReferrals extends JFrame {
              public FrmReferrals() {
                   super();
                   init();
              protected void init() {
                   jbInit();
              protected void closeIt() {
                   uninit();
              // variables here
              protected Dimension          dimPreferred     = new Dimension(1270, 995);
              protected JTabbedPane     tabbedPane          = new JTabbedPane();
              protected JTable          tblReferrals     = null;
              protected PopupMenu          popMenu           = new PopupMenu();
              protected void jbInit() {
                   setPreferredSize(dimPreferred);
                   setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                   setTitle("Referrals");
                   JPanel pnl = new JPanel();
                   pnl.setOpaque(false);
                   pnl.setLayout(new BorderLayout());
                   pnl.add(tabbedPane, BorderLayout.CENTER);
                   // put it all in the frame
                   add(pnl);
                   pack();
                   setLocationRelativeTo(null);
                   // init the table and model
                   ReferralsTableModel ctm = new ReferralsTableModel(buildDummyVector());
                   tblReferrals = new JTable(ctm);
                   tblReferrals.setComponentPopupMenu(popMenu);
                   tblReferrals.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                   tabbedPane.add(new JScrollPane(tblReferrals, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));
                   addWindowListener(new WindowListener() {
                        @Override
                        public void windowActivated(WindowEvent e) {}
                        @Override
                        public void windowClosed(WindowEvent e) {}
                        @Override
                        public void windowClosing(WindowEvent e) {
                             closeIt();
                        @Override
                        public void windowDeactivated(WindowEvent e) {}
                        @Override
                        public void windowDeiconified(WindowEvent e) {}
                        @Override
                        public void windowIconified(WindowEvent e) {}
                        @Override
                        public void windowOpened(WindowEvent e) {}
              protected Vector<DBO_Referrals> buildDummyVector() {
                   Vector<DBO_Referrals> vr = new Vector<DBO_Referrals>();
                   for (int x = 0; x < 5000; x++) {
                        DBO_Referrals r = new DBO_Referrals(x+(5000*ctr));
                        vr.add(r);
                   return vr;
              protected void uninit() {
                   tblReferrals.setComponentPopupMenu(null);
                   for (Component c : popMenu.getComponents()) {
                        PropertyChangeListener[] pl = c.getPropertyChangeListeners();
                        for (PropertyChangeListener l : pl)
                             c.removePropertyChangeListener(l);
                        if (c instanceof JMenuItem) {
                             ActionListener [] al = ((JMenuItem)c).getActionListeners();
                             for (ActionListener l : al) {
                                  ((JMenuItem)c).removeActionListener(l);
                   popMenu = null;
              protected class DBO_Referrals {
                   protected long          id;
                   protected String     Employee;
                   protected String     Rep;
                   protected String     Asst;
                   protected String     Client;
                   protected String     Dates;
                   protected String     Status;
                   protected String     Home;
                   public DBO_Referrals(long id) {
                        this.id = id;
                        Employee = "Employee" + id;
                        Rep = "Rep" + id;
                        Asst = "Asst" + id;
                        Client = "Client" + id;
                        Dates = "Dates" + id;
                        Status = "Status" + id;
                        Home = "Home" + id;
                   public long getId() {
                        return id;
                   public String getEmployee() {
                        return Employee;
                   public String getRep() {
                        return Rep;
                   public String getAsst() {
                        return Asst;
                   public String getClient() {
                        return Client;
                   public String getDates() {
                        return Dates;
                   public String getStatus() {
                        return Status;
                   public String getHome() {
                        return Home;
              public class ReferralsTableModel extends AbstractTableModel {
                   protected Vector<DBO_Referrals>          data          = new Vector<DBO_Referrals>();
                   protected String[]                         sColumns     = {"id", "Employee", "Rep", "Assistant", "Client", "Date", "Status", "Home", "R"};
                   public ReferralsTableModel() {
                        super();
                   public ReferralsTableModel(Vector<DBO_Referrals> data) {
                        this();
                        this.data = data;
                   @SuppressWarnings("unchecked")
                   @Override
                   public Class getColumnClass(int col) {
                        switch (col) {
                             case 0 :
                                  return Long.class;
                             default :
                                  return String.class;
                   @Override
                   public int getColumnCount() {
                        return sColumns.length;
                   @Override
                   public int getRowCount() {
                        return data.size();
                   @Override
                   public Object getValueAt(int row, int col) {
                        if (row > data.size())
                             return null;
                        DBO_Referrals a = data.get(row);
                        switch (col) {
                             case 0 :
                                  return a.getId();
                             case 1 :
                                  return a.getEmployee();
                             case 2 :
                                  return a.getRep();
                             case 3 :
                                  return a.getAsst();
                             case 4 :
                                  return a.getClient();
                             case 5 :
                                  return a.getDates();
                             case 6 :
                                  return a.getStatus();
                             case 7 :
                                  return a.getHome();
                             case 8 :
                                  return "+";
                             default :
                                  return null;

    BTW instead of continually printing out the memory use a profiler (jvisualvm in the jdk/bin directory -> heapdump -> search on your class -> view in instances -> find nearest GC root).
    Looks like BasicPopupMenuUI doesn't remove a reference to the JRootPane immediately. As far as I can see it will be removed when another menu shows.
    As a hackish workaround you can try this in you FrmReferrals#uninit():
                for(ChangeListener listener : MenuSelectionManager.defaultManager().getChangeListeners()) {
                    if (listener.getClass().getName().contains("MenuKeyboardHelper")) {
                        try {
                            Field field = listener.getClass().getDeclaredField("menuInputMap");
                            field.setAccessible(true);
                            field.set(listener, null);
                        } catch (Exception e) {
                            // ignored
                        break;
                }Funnily enough though it isn't there when I reduce your code to a SSCCE:
    import java.awt.*;
    import javax.swing.*;
    public class TestBasicPopupMenuUILeak extends JFrame {
        public TestBasicPopupMenuUILeak() {
            super("Not collected right away");
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    JFrame frame = new JFrame("Test");
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.getContentPane().add(
                            new JButton(new AbstractAction("Show frame") {
                                @Override
                                public void actionPerformed(ActionEvent e) {
                                    EventQueue.invokeLater(new Runnable() {
                                        public void run() {
                                            JLabel label = new JLabel(
    "Right click to show popup, then close this frame."
    + "The frame with not be GCed until another (popup) menu is shown.");
                                            JPopupMenu popup = new JPopupMenu(
                                                    "Popup");
                                            popup.add("Item");
                                            label.setComponentPopupMenu(popup);
                                            // named differently so you can find it
                                            // easily in your favorite profiler
                                            JFrame frame = new TestBasicPopupMenuUILeak();
                                            frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                                            frame.getContentPane().add(label);
                                            frame.pack();
                                            frame.setLocationRelativeTo(null);
                                            frame.setVisible(true);
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
    }

  • Memory leak when I use function with bstr_t type

    Hello,
    I use Visual C++ 6 and TestStand 3.1.
    I use the tool: Purify from Rational Instruments to detect memory leak in my code.
    When I use in my code, functions from the TestStand API using bstr_t types: GetValString, GetType... memory leaks appear.
    Do you have an idea to solve this problem?
    Thanks

    Breizh,
    Etes vous sur que le problèmes soit lié au type bstr_r ?
    Pouvez vous me faire parvenir un exemple de code mettant en oeuvre la fuite mémoire?
    Raphaël T.
    NI FRANCE
    Cordialement,
    Raphael T

  • Memory leak with CGImageSourceCreateThumbnailAtIndex

    After creating a thumbnail with CGImageSourceCreateThumbnailAtIndex, CGImageRelease doesn't seem to work!? I am rendering full-size thumbnails of PDF pages, and this just leaks memory:
    void memLeakTest(CFStringRef sourcePath) {
    printf("Running memLeakTest...
    CFURLRef url = CFURLCreateWithString(NULL, sourcePath, NULL);
    CGImageSourceRef imageSource = CGImageSourceCreateWithURL(url, NULL);
    CFStringRef keys[3];
    CFTypeRef values[3];
    int n=0;
    keys[n] = kCGImageSourceCreateThumbnailFromImageAlways;
    values[n++] = kCFBooleanTrue; //If I set this to false, there is no leak, but I need the thumbnails
    keys[n] = kCGImageSourceCreateThumbnailWithTransform;
    values[n++] = kCFBooleanTrue;
    keys[n] = kCGImageSourceShouldCache;
    values[n++] = kCFBooleanFalse;
    CFDictionaryRef options;
    options = CFDictionaryCreate(kCFAllocatorDefault, (const void **)keys, values, n, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
    CGImageRef image = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options);
    CFRelease( imageSource );
    CGImageRelease( image ); //Doesn't seem to have any effect. Memory continues to balloon.
    CFRelease( url );
    int main (int argc, const char * argv[]) {
    CFStringRef pathUrl = CFSTR("file:/path/to/a/big.pdf");
    while( true ) {
    memLeakTest( pathUrl );
    if( n < maxPages ) sleep(5); //Wait 5 seconds
    return 0;

    I was able to fix the memory leak using the following code:
    void memLeakTest(CFStringRef sourcePath) {
    printf("Running memLeakTest...
    CFURLRef url = CFURLCreateWithString(NULL, sourcePath, NULL);
    CFStringRef keys[10];
    CFTypeRef values[10];
    int n=0;
    //keys[n] = kCGImageSourceCreateThumbnailFromImageIfAbsent;
    //values[n++] = kCFBooleanTrue;
    keys[n] = kCGImageSourceCreateThumbnailFromImageAlways;
    values[n++] = kCFBooleanTrue;
    keys[n] = kCGImageSourceCreateThumbnailWithTransform;
    values[n++] = kCFBooleanTrue;
    keys[n] = kCGImageSourceShouldCache;
    values[n++] = kCFBooleanFalse;
    CFDictionaryRef options;
    options = CFDictionaryCreate(kCFAllocatorDefault, (const void **)keys, values, n,
    &kCFTypeDictionaryKeyCallBacks,
    &kCFTypeDictionaryValueCallBacks);
    //CGImageSourceRef imageSource = CGImageSourceCreateWithURL(url, options);
    NSImage* imageFile = [[NSImage alloc] initByReferencingURL: (NSURL *)url];
    NSData * data = [imageFile TIFFRepresentation];
    CGImageSourceRef imageSource = CGImageSourceCreateWithData((CFDataRef)data, options);
    CGImageRef image = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options);
    CFRelease( image );
    CFRelease( imageSource );
    [imageFile release];
    CFRelease( options );
    CFRelease( url );
    There are a number of different graphics APIs you could use. I'm no expert in any of them, so I used the simple ones. The above code requires both Objective-C and an autorelease pool, but I'm sure you could use different functions to remove those requirements.

  • Memory Leak with Flash Game - video of incident - Fix?

    My hypothesis:
    There is a memory leak in Flash Player that leads to Flash crashing, predictably and repeatedly, when used.
    My question:
    When will this problem be fixed?
    Evidence:
    Observe the progression in the following single-take video of me playing my favorite Flash game, posted to Youtube.  Skip to the times indicated in the "About" description for the video to observe the increase in use of physical memory, as observed in Windows Task Manager, until there isn't anything left.
    http://www.youtube.com/watch?v=gNIJvTuUitU
    My computer gets bogged down, the game stalls out, and Flash needs to be closed to enable my computer to function once more.  It makes it impossible to play this specific game for very long, and is an insidious problem lurking in the background every time I watch a video, play a game, or use Flash Player for any purpose.  My computer always slows down, with the problem worsening as time passes until I need to close everything and start again.
    Details:
    Flash Player Version: 11.7.700.224
    Operating System: Windows Vista (32-bit)
    Browser: Mozilla Firefox
    (Also happens when using Google Chrome)
    Conclusion:
    If you need further information about my specific computer, please feel free to ask.
    If this problem is specific to my computer, I would appreciate knowing this and determining a way to solve the problem.  My suspicion is that the problem originates in Flash Player itself and is experienced by many people in a variety of circumstances.  It is my hope that an articulate response indicating how long it will take to correct this bug in Flash Player can be provided.
    Thanks in advance for your help.

    My hypothesis:
    There is a memory leak in Flash Player that leads to Flash crashing, predictably and repeatedly, when used.
    My question:
    When will this problem be fixed?
    Evidence:
    Observe the progression in the following single-take video of me playing my favorite Flash game, posted to Youtube.  Skip to the times indicated in the "About" description for the video to observe the increase in use of physical memory, as observed in Windows Task Manager, until there isn't anything left.
    http://www.youtube.com/watch?v=gNIJvTuUitU
    My computer gets bogged down, the game stalls out, and Flash needs to be closed to enable my computer to function once more.  It makes it impossible to play this specific game for very long, and is an insidious problem lurking in the background every time I watch a video, play a game, or use Flash Player for any purpose.  My computer always slows down, with the problem worsening as time passes until I need to close everything and start again.
    Details:
    Flash Player Version: 11.7.700.224
    Operating System: Windows Vista (32-bit)
    Browser: Mozilla Firefox
    (Also happens when using Google Chrome)
    Conclusion:
    If you need further information about my specific computer, please feel free to ask.
    If this problem is specific to my computer, I would appreciate knowing this and determining a way to solve the problem.  My suspicion is that the problem originates in Flash Player itself and is experienced by many people in a variety of circumstances.  It is my hope that an articulate response indicating how long it will take to correct this bug in Flash Player can be provided.
    Thanks in advance for your help.

  • Memory leak with CryptGetProvParam

    I suspect there is a memory leak in the function CryptGetProvParam. I made a Win32Console app in Visual Studio 2008 to recreate the problem. With the example app running it is possible to use Task Manager to see the memory usage of the .exe steadily increase
    over time.
    I called the app TestSecurityDescriptorWin32Console. Below I have pasted the contents of TestSecurityDescriptorWin32Console.cpp.
    I am looking to verify that the problem is with the CryptGetProvParam function, and if this is the case then to get the bug fixed.
    Thank you for any help
    // TestSecurityDescriptorWin32Console.cpp : Defines the entry point for the console application.
    #include "stdafx.h"
    #include <windows.h>
    HCRYPTPROV GetContext();
    void ModifyCryptProvSecurity(HCRYPTPROV hProv);
    int _tmain(int argc, _TCHAR* argv[])
    DWORD dwSDLen = 0;
    HCRYPTPROV hProv = GetContext();
    // get dwSDLen
    printf("First CryptGetProvParam: %d\n",CryptGetProvParam(hProv,PP_KEYSET_SEC_DESCR, NULL, &dwSDLen, DACL_SECURITY_INFORMATION));
    while (1) {
    BYTE* pbSD = (BYTE*)LocalAlloc(LHND,dwSDLen);
    PSECURITY_DESCRIPTOR
    pSD = (PSECURITY_DESCRIPTOR)pbSD;
    InitializeSecurityDescriptor(pSD,SECURITY_DESCRIPTOR_REVISION);
    // make pbSD size dwSDLen
    printf("Second CryptGetProvParam: %d\n",CryptGetProvParam(hProv,PP_KEYSET_SEC_DESCR, pbSD, &dwSDLen, DACL_SECURITY_INFORMATION));
    SECURITY_DESCRIPTOR*
    pSecurityDescriptor = (SECURITY_DESCRIPTOR*)pbSD;
    if (pSecurityDescriptor->Owner != NULL) FreeSid(pSecurityDescriptor->Owner);
    if (pSecurityDescriptor->Group != NULL) FreeSid(pSecurityDescriptor->Group);
    if (pSecurityDescriptor->Sacl != NULL) LocalFree(pSecurityDescriptor->Sacl);
    if (pSecurityDescriptor->Dacl != NULL) LocalFree(pSecurityDescriptor->Dacl);
    LocalFree(pbSD);
    Sleep(100);
    return 0;
    HCRYPTPROV GetContext()
    HCRYPTPROV hProv = NULL;
    HCRYPTKEY hKey = NULL;
        CHAR szPPName[100];
        DWORD dwPPNameLen = 100;
        CHAR szPPContainer[100];
        DWORD dwPPContainerLen = 100;
        // Attempt to acquire a handle to the default key container.
        if (CryptAcquireContext(
    &hProv,
    NULL,
    MS_DEF_PROV,
    PROV_RSA_FULL,
    CRYPT_MACHINE_KEYSET))
    printf("Opened default key container for crypto usage");
    else
    // Some sort of error occured...
    printf("(Allowable) Error acquiring default key container for crypto usage - ");
    // .. try to create default key container.
    if(CryptAcquireContext(
    &hProv,
    NULL,
    MS_DEF_PROV,
    PROV_RSA_FULL,
    CRYPT_MACHINE_KEYSET | CRYPT_NEWKEYSET))
    printf("Created key container for crypto usage");
    else
    printf("Error Creating key container for crypto usage - ");
    return (NULL);
    // Get CSP name.
    if(CryptGetProvParam(
    hProv,
    PP_NAME,
    (BYTE *)szPPName,
    &dwPPNameLen,
    0))
    printf("Key CSP name is '%s'",szPPName);
    else
    // Error getting key container name.
    printf("Failed to retrieve CSP name - ");
    // Get name of key container.
    if(CryptGetProvParam(
    hProv,
    PP_CONTAINER,
    (BYTE *)szPPContainer,
    &dwPPContainerLen,
    0))
    printf("Key container provider name is '%s'",szPPContainer);
    else
    // Error getting key container name.
    printf("Failed to retrieve key container name - \n");
    return hProv;

    "BYTE* pbSD = (BYTE*)LocalAlloc(LHND,dwSDLen);"
    LHND? It's surprising that this doesn't crash the program. Use LPTR.
    More generally, stay away from LocalAlloc/LocalFree, use malloc/new/HeapAlloc. Use LocalAlloc only if the API you're working with specifically requires LocalAlloc, that's rare.

  • Memory Leak with RDC (11.5.11.1732) using SetDataSource

    I believe I have identified a 20 byte memory leak each time a VB6 application calls Report.Database.SetDataSource and passes an ADO recordset (in craxdrt.dll version 11.5.11.1732 and earlier).
    I've created a simple VB application which demonstrates the problem. The program repeatedly loads a report and optionally calls SetDataSource.
    When running the program and monitoring for leaks with DebugDiag I observe the same 20 byte leak that I see in my live application if I enable calls to SetDataSource. Without the calls there is no leak.
    I have uploaded the VB source code for the test application, RPT file used for the test and the reports from DebugDiag for both the leaky and non-leaky runs to [http://www.turambar.co.uk/download/crystal/CrystalTest.zip]
    The two DebugDiag reports are as follows:
    Memory_Report__Project1.exe__10212009140853486.mht - run with no calls to SetDataSource
    Memory_Report__Project1.exe__10212009140007780.mht - run with calls to SetDataSource
    Looking at the second of these reports it can be seen that the leak originates at "Project1!Form1::SDS+ec C:\CrystalTest\Form1.frm @ 89". That function contains a single line of code which calls SetDataSource.
    Our live application is using CRXI R1 RTM (which has other leaks too but those disappear when upgrading to SP4).
    For this test application I have used CRXI R2 with FixPack 5.6 and the error still manifests.
    Option Explicit
    Dim objApp As CRAXDRT.Application
    Private Sub Form_Load()
        Set objApp = New CRAXDRT.Application
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
        Set objApp = Nothing
    End Sub
    Private Sub Command1_Click()
        Dim i As Long
        Command1.Enabled = False
        DoEvents
        For i = 1 To CLng(Text1.Text)
            Call Stress
        Next
        Command1.Enabled = True
    End Sub
    Sub Stress()
        Dim objRep As CRAXDRT.Report
        Dim objRec As ADODB.Recordset
        Set objRec = New ADODB.Recordset
        Set objRep = objApp.OpenReport("test.rpt")
        If Check1.Value = vbChecked Then
             Call SDS(objRep, objRec)
        End If
        Set objRep = Nothing
    End Sub
    Sub SDS(objRep As CRAXDRT.Report, objRec As ADODB.Recordset)
        Call objRep.Database.SetDataSource(objRec)
    End Sub

    I've retested using VB.NET 2005. Still using ADO recordsets to pass the data through to Crystal.
            Dim objRep As ReportDocument
            Dim objRec As ADODB.Recordset
            Dim objConn As ADODB.Connection
            objConn = New ADODB.Connection
            objConn.Open("Provider=SQLOLEDB.1;Data Source=DB-HOST;Initial Catalog=TestDB", "simon", "mypass")
            objRec = New ADODB.Recordset
            objRec.CursorLocation = ADODB.CursorLocationEnum.adUseClient
            objRec.CursorType = ADODB.CursorTypeEnum.adOpenStatic
            objRec.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic
            objRec.Open("SELECT TOP 1 * FROM simon.mytable", objConn)
            objRep = New ReportDocument
            objRep.Load("test.rpt")
            If Check1.CheckState = System.Windows.Forms.CheckState.Checked Then
                objRep.SetDataSource(objRec)
            End If
            objRep.Close()
            objRep.Dispose()
            objRep = Nothing
            objRec.ActiveConnection = Nothing
            objRec.Close()
            objRec = Nothing
            objConn.Close()
            objConn = Nothing
    With the calls to SetDataSource in place DebugDiag is again reporting various leaks which do not happen when that call is not made. I'm not too hot on .NET code so I hope I'm doing all the right things to clear down before I do the leak analysis. My main calling form forces GC cleanup before I start the dump:
            GC.Collect()
            GC.WaitForPendingFinalizers()
    I'm running this on Windows Server 2003 R2 SP2 with hotfix 939527 installed. For Crystal I installed CrystalReports11_5_NET_2005.msi from the 5.6 fixpack.
    Simon

  • Memory Leak with the new PatchMix App Beta?

    E6300/ASUS P5B-D/2GB RAM/EMU 0404/Vista Ultimate 32bit
    The problem happens after I upgrade to the PatchMix driver set dated 9/11.
    The physical memory usage bumps from ~24M to 150M after running 24 hours, and I didnt load any FX.
    The commit size(real memory usage) is over 500M!
    This doesnt happen with the old beta driver.
    Anyone has the same problem?

    Emon wrote:
    jreid wrote:
    Dare I suggest the problem might be Vista?
    Yes? How exactly would Vista cause a memory leak within PatchMix DSP's GUI?
    Well, just a thought. The OS is ultimately responsible for all memory management, and also the low-level graphics functions that would be called by e.g. the GUI code. I just noticed that people on XP didn't seem to be having the same problems with this beta.

  • How to root out memory leak with  Java JNI & Native BDB 11g ?

    We are testing a web application using the 32-bit compiled native 11g version of BDB (with replication) under 32-bit IBM 1.5 JVM via JNI under 64-bit RedHat Linux. We are experiencing what appears to be a memory leak without a commensurate increase in Java heap size. Basically the process size continues to grow until the max 32-process size is reached (4Gb) and eventually stops running (no core). Java heap is set to 2Gb min/max. GCs are nominal, so the leak appears to be native and outside Java bytecode.
    We need to determine whether there is a memory leak in BDB, or the IBM JVM or simply a mis-use of BDB in the Java code. What tools/instrumentation/db statistic should be used to help get to root cause? Do you recommend using System Tap (with some particular text command script)? What DB stats should we capture to get to the bottom of this memory leak? What troubleshooting steps can you recommend?
    Thanks ahead of time.
    JE.
    Edited by: 787930 on Aug 12, 2010 5:42 PM

    That's troublesome... DB itself doesn't have stats that track VM in any useful way. I am not familiar with SystemTap but a quick look at it seems to imply that it's better for kernel monitoring than user space. It's pretty hard to get DB to leak significant amounts of memory. The reason is that it mostly uses shared memory carved from the environment. Also if you are neglecting to close or delete some object DB generally complains about it somewhere.
    I don't see how pmap would help if it's a heap leak but maybe I'm missing something.
    One way to rule DB out is to replace its internal memory allocation functions with your own that are instrumented to track how much VM has been allocated (and freed). This is very easy to do using the interfaces:
    db_env_set_func_malloc()
    db_env_set_func_free()
    These are global to your process and your functions will be used where DB would otherwise call malloc() and free(). How you get usage information out of the system is an exercise left to the reader :-) If it turns out DB is the culprit then there is more thinking to do to isolate the problem.
    Other ideas that can provide information if not actual smoking guns:
    -- accelerate reproduction of the problem by allocating nearly all of the VM to the JVM and the DB cache (or otherwise limit the allowable VM in your process)
    -- change the VM allocated to the JVM in various ways
    Regards,
    George

  • How can i detect "Memory leak" with large LabVIEW projects.

    Hi,
    I have a huge LabVIEW application that runs out of memory after running continuously for some time. I am not able to find out the VI that is hogging up memory. Is there any tool that dynamically detects the VI that is leaking memory.
    Or, is there a tool or a way to identify the critical areas which can be potential culprits that is leaking memory.
    Regards
    Bharath

    Bdev wrote:
    Thanks Dennis.
    I think Desktop Execution toolkit should solve the problem. 
    Wayne Wrote
    Have you tried Tools»Profile»Performance and Memory ?  http://zone.ni.com/reference/en-XX/help/371361F-01/lvdialog/profile/
    But this will just give me the amount of memory used by the VIs and not the amount of memory that is not getting released.
    And where is the problem about that? Just try to find what VIs keep increasing in memory size. That are the culprits. If you have real memory leaks, meaning there is memory that is not managed by LabVIEW directly but for instance by a DLL somewhere and that DLL looses references to memory, so it goes really lost, then the only way to find that is by successively exclude functionality in your application until you can find the culprit.
    There is no other simple way to find out about who is loosing memory references than by doing debugging by exclusion until the problem disappears. The only way to speed this up, which quite often works for me is doing an educated guess, about what components are most likely to do this misbehaviour.
    Not knowing anything about your application and if you are talking about memory hogs (fairly easily identifiable by the mentioned Performance and Memory monitor) or actual memory leaks, it is hard to tell how to go about it. Memory hogs are usually the first thing I suspect escpecially with software I inherit somehow from people from whom I'm not sure they know all the ins and outs of LabVIEW programming.
    If a leak seems likely the first culprit usually are custom DLLs (yes even DLLs I have written myself), then NI DLLs such as DAQmx, etc. and last there come leaks in LabVIEW itself. This last category is very seldom but it has happened to me. However before going to scream about LabVIEW having a memory leak you really, really should make sure you have very intensivly researched all the other possibilities. The chance that you run into a memory leak in LabVIEW, while not impossible, is so small compared to the other ways of causing either a memory hog or running into a leak in an external component to LabVIEW, that in 99.9% of the cases where someone screams about a LabVIEW memory leak, he is simply wrong.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for

  • Error in Email Link

    I'm creating a new PDF fillable form from a Word document.  There are references to two email addresses in the letter. When I create the pdf from Word, one of the email addresses is coming out correctly (mailto:[email protected]), but the other addre

  • Unable to import signed cert in keystore

    Hi everybody ! I've been using keytool for years to generate client certificates that I would send to an enrollment server to get it signed by the CA. Here is the sequence : (1) Generating the key pair : keytool.exe -genkey -alias client-cert -keyalg

  • MacBook Pro upgrade to the Yosemite OS. The CC icon is gone

    I just upgraded my MacBook Pro to the Yosemite OS. The CC icon is gone: how do I re-install and update?

  • Difference balance between FK10N and FBL1N

    Hi All, In FK10N for a vendor for year 2012 there is a cumulative balance carried forward from previous year is 3711.80 When checked in FBL1N there is no items for 'Open items' and for 'all items' the balance is ZERO. Will balance of FK10N has to mat

  • Place InfoObjects under  InfoObject  Catalog

    Hi Guys, I have few InfoObjects (IO) under unassigned infoarea and want to place under particular infoarea. I am telling IO name, IO Catalog name etc. reading a tab delimited text file which are already exists in server. Here is the structure: IO_CAT