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

Similar Messages

  • 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...

  • 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 in Algorithms.Cast function?

    I have the following line in my code:
    Algorithms.Cast(OrigImage, tempRGB, ImageType.Rgb32)
    OrigImage is a U8. It appears to have a 7mb memory leak.
    Before: 81168K,
    After:    88560K
    Has anyone else noticed this? Is there a fix?
    Note: I properly dispose of all images when I am done using them.
    Thanks!

    Can you describe the situation a little bit more? What memory are you refering to when you say "Before: 81168K, After:    88560K"? Are you talking about the total amount of memory reserved by the application?
    The cast function will convert an image of one type to another. If you were going from a U8 image to an RGB 32, the new image would require about 12 times the memory as the original image. 7 Mb would be a reasonable amount of memory increase for this process.
    Jeremy P.
    Applications Engineer
    National Instruments

  • Memory Leak in terminateConnection() function. How to resolve it ???

    Hi,
    We are facing a memory leak issue in terminateConnection() function. Here is a sample code regarding that. We have run around 1.5 hours simultaneously and it was consuming around 250MB for this simple program. How could I resolve this problem ?
    bool test()
        string userName = "mapserver";
        string password = "a";
        string connectString = "//localhost:1521/orcl";
        string query = "SELECT GEOMETRY AS GEOM FROM AG_WATER";
        Environment *env = Environment::createEnvironment(Environment::OBJECT);
            Connection *conn;
            Statement *stmt;
            ResultSet *rs;
            try{
                conn = env->createConnection(userName, password, "");
            catch (SQLException ex) {
                printf("ORACLE execution error: [Error Code : %d] : %s\n", ex.getErrorCode(), ex.getMessage().c_str());
                return false;
            env->terminateConnection(conn);
            stmt = NULL;
            conn = NULL;
            rs = NULL;
        Environment::terminateEnvironment(env);
        return true;
    int main()
        OracleResultSet pResultSet;
        while (true) {
            test();
        return 0;
    Does any body help me to find out this problem ???

    This is not a web dynpro related question.  Please restrict the questions in this forum to the Web Dynpro ABAP topic.

  • 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 JCO when calling an ABAP-function that returns larg tables

    Hello everybody,
    I think discovered a memory leak in JCO when the calling functionions that have exporting tables with large datasets. For example the ABAP-function RFC_READ_TABLE, which in this example I use to retrieve data from a table called "RSZELTTXT", which contains ~ 120000 datasets. RFC_READ_TABLE exports the data as table "DATA".
    Here a simple JUnit test:
    http://pastebin.ca/1420451
    When running it with Sun Java 1.6 with standard heap size of 64mb I get a heapsize OutOfMemory error:
    http://pastebin.ca/1420472
    Looking at the heap dump (which I unfortunately cannot post here, because of it' size), I can see that I've 65000 char[512] array objects in my heap, which don't get cleaned up. I think, each char[512] array stands for one dataset in the exporting table "DATA", since the table contains 120000 datasets, the heap is full after the first 65000 datasets are parsed. Apparently, JCO tries to read all datasets in memory instead of justing reading the dataset to which the pointer (JCoTable.setRow(i)) currently points to and releasing it from memory after the pointer moves forward ...
    Did anybody else experience this?
    Is SAP going to remove to issue in upcoming versions of JCO?
    regards Samir

    Hi,
       Check Below links
    1) How To Analyze Performance Problems JCO
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3fbea790-0201-0010-6481-8370ebc3c17d
    2) How to Avoid Memory Leaks 
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c3e598fe-0601-0010-e990-b8622840c8c2
    Salil...
    Edited by: salil chavan on Jun 2, 2009 5:21 AM

  • External Function memory leak

    The ExternalFunction.java sample code distributed with v.2.5.16 has a memory leak.
    You can see this by changing the loop to iterate a million times; eventually it runs out of memory and crashes.
    (I used jdk 1.7 u2 on Windows 7.)
    I tried adding explicit calls to delete() for every created Java object in the example, none of which helped.
    As far as I can tell, it is simply not possible to use external functions from Java without leaking memory.
    Any thoughts on this?

    thanks Silviu
    i create two bugs
    https://bugbase.adobe.com/index.cfm?event=bug&id=3341143
    https://bugbase.adobe.com/index.cfm?event=bug&id=3341146

  • Memory leak in a function registered using set_restore_function()

    I experience a problem with memory leak caused by the following function:
    void RestorePhonemesSet(PhonemesSetStructType &phonemesSet, const void *src) {
    char p = (char ) src;
    memcpy(&phonemesSet.len, p, sizeof (int));
    p += sizeof (int);
    memcpy(&phonemesSet.whichFile, p, sizeof (int));
    p += sizeof (int);
    memcpy(&phonemesSet.whichPosition, p, sizeof (int));
    p += sizeof (int);
    phonemesSet.phonemes = (int *)malloc(sizeof(int)*phonemesSet.len);
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ here the problematic code
    memcpy(phonemesSet.phonemes, p, sizeof (int) * phonemesSet.len);
    This function is registered using a following call: DbstlElemTraits<PhonemesSetStructType>::instance()->set_restore_function(RestorePhonemesSet);
    The culprit it the malloc memory allocation. If I leave out the malloc the program crashes. If I free the phonemeSet.phonemes memory segment at the end of the restore function I lost data, and if I use the malloc there is a large memory leak while reading every record from the database.
    What should I do to prevent the memory leak?
    Regards,
    markur
    Edited by: 904259 on 2011-12-24 05:42

    the solution is using the memory allocated for p, no need to allocate new memory space for the variable: the problematic line should look like .phonemes = (int *)p;
    the memcpy function in the following line is thus superfluous.
    Edited by: 904259 on 2011-12-24 05:43

  • Applet calling javascript function causing memory leak

    Hi,
    I'm troubleshooting one memory leak issue in my application and to do that I created one simple Java applet and HTML + javascript function to locate the problem.
    Basically it's an applet calling a javascript function using a timer. The javascript function simply does nothing.
    I tested in IE 8.0 and JRE 1.6.0_23-b05 and memory of IE keeps increasing.
    I saw this bug http://bugs.sun.com/view_bug.do?bug_id=6857340 which seems related with my issue, but if I understand correctly from the page, the issue should have been fixed.
    I posted this message to find out if others also find same issue and if there's a solution for this. If I comment out window.call("dummy", null); , memory will not climb up.
    Java code
    +public class Main extends Applet implements Runnable  {+
    public Applet currentApplet= this ;
    +     public JSObject window = null;+
    +public void run(){+
    +          System.out.println("run..");+
    +     }+
    +public void start(){+
    window = JSObject.getWindow(this);
    int delay = 300; //milliseconds
    +ActionListener taskPerformer = new ActionListener() {+
    +public void actionPerformed(ActionEvent evt) {+
    window.call("dummy", null);
    +}+
    +};+
    new Timer(delay, taskPerformer).start();
    +     }+
    +public static void main(String[] args) {+
    +          System.out.println("start...");+
    +          Main main = new Main();+
    +     main.start();+
    +     }+
    +}+
    Javascript source code
    +<html>+
    +<head>+
    +<script>+
    +function dummy() {+
    +     +
    +}+
    +</script>+
    +</head>+
    +<body>+
    +<applet .... >+
    +...+
    +</html>+

    Try this url:
    http://www.inquiry.com/techtips/java_pro/10MinuteSolutions/callingJavaScript.asp
    It also provides some examples.

  • Memory leak in dll with an imaq-function

    Hi,
    I am currently writing a dll which uses the imaqImageToArray function.
    Of course this function allocates new memory every time it converts a picture, and as I convert 180 pics a second and the Program shopuld run for hours that is quite a problem for me.
    The solution should of course be the function free(void* MyPointer). And if I use malloc to allocate some random memory, instead of the imaqImageToArray, this works perfectly.
    However when I call free() to release memory allocated by the imaqImageToArray function, the dll/LabView-Program will crash.
    So I wonder what function the imaq-Functions use to allocate memory and how I can get rid of it again. Is there another imaq-function?
    Thanks already!
    Greetings
    Solved!
    Go to Solution.

    Hi,
    sorry for the misunderstanding. I use the imaqImageToArray function inside the .dll. The Code Hence is a c-code.
    #include "extcode.h"
    #include "nivision.h"
    ... some stuff/the dll-function etc....
    uint8_t *Pointer;
    Pointer = (uint8_t)imaqImageToArray(MyImage,MyRect,&Rows,&Columns);
    if(Pointer!= NULL)
         free(Pointer);
    ... other stuff
    Sadly I can't find a detailed description of the function. I assume the void* Pointer returned by imaqImageToArray points to an Array, however I am not sure wether it points to a usual c-array or a LabView Array, meaning:
    typedef struct {
        int32_t dimSize;
        double Element[1];
        } LVArray;
    That would explain why free(); won't work.
    I think I got a step further though, as I found a function in the "extcode.h" called    DSDisposePtr(void *p). That should be the equivalent to free() for LabView Datastructures.
    However even though I have included everything from the cintools directory explicitly to the project, the Linker complains about a not found externic object. Anyone knows which .lib files I need to include where to be able to use that function?
    Thanks

  • Plugin-container.exe takes over and uses 100% of my CPU locking me out and leaving my PC non-functioning. Is this a bug, or a memory leak, in the Firefox software? Can anything be done to fix this problem?

    In looking at Windows Task Manager I found that plugin-container.exe was taking over 100% of my CPU and my system was frozen. Is this a memory leak or other bug?

    Thank you! I have been having problems with Adobe Flash since downloading the new 11.1 version. I will download it again and reinstall it, hopefully that will correct the problem.

  • Memory leak when passing variables to functions in StarOffice Basic

    The following code generates a fast memory leak:
    Sub Main
    Dim i&
         for i = 1 to 1000000
              Model(i)
         next i
    End Sub
    Sub Model(j&)
         j = j
    End Sub
    But if you put the contents of Sub Model into Main, or if you make j a public variable and don't pass it explicitly to Model, the memory leak disappears.
    Message was edited by:
    capnbob

    That's a bit different for event handlers like the onRelease
    event of buttons.
    mybutton.onRelease = myfunction(1); -> the code will
    execute right away without waiting for the event to fire
    mybutton.onRelease = myfunction(); -> the code will
    execute right away without waiting for the event to fire
    mybutton.onRelease = myfunction; -> myfunction gets called
    after the event onRelease fires.
    See attached code.

  • I am getting a memory leak that sometimes leads to an unresponsive Firefox, but does not crash per se.

    Hello, For the last couple of months, I am having issues with one of my tabs or the program itself causing a memory leak. I was hoping that subsequent releases would fix the problem, but when I downloaded V.11 it did not help.
    I use tab mix plus and at any time, usually have about 25 tabs open. Everything functioned okay for 8 or so months up until recently.
    I am wondering if there is a way to try to track down what is causing the leak. If it is one of my open pages, i will get rid of it. I tried opening one page at a time from scratch, but could not find the issue. .
    I always have flash block enabled to cut down on the website junk.
    using OSX firefox v11.

    Now, I'm not going to say it's an Add-On problem because from the research I've been doing on this problem for the last half hour shows that everyone has DIFFERENT add-ons, but everyone's having the SAME problem....
    So I went through my add-ons and disabled them one by one, and the single add-on that has been giving me grief is the latest WOT add-on. So, I have Firefox 11 (so does my wife) and we both have the WOT add-on. But that's where the similarity ends... I have Windows 7 x64, she has Windows XP x86.... but she doesn't have the memory leak problem.
    What I see is a sawtooth pattern over time. Memory goes up a little over 30+ seconds, then drops down. But over half an hour, the peaks of the sawtooth are larger, and it doesn't drop back down to the same level again - always a little more than before. And before you know it, FF is peaking at 1.5+GB, dropping down to 1.2GB... and FF is running very, very slowly.... excessive disk accesses (paging probably, though I apparently I still have 1.5 to 2.0 GB of free RAM). Killing FF frees it all up, and if I open FF again, it's back to using 250MB of RAM.
    So, it's not the add-ons per se, but how they're interacting with FF (or the other way round).... most likely, it's this plug-in container they created to stop add-ons from taking FF with them when they crashed. Seems to have created more problems than it has solved..... would be great if you could choose not to use it....

  • Allocated memory pool was not deleted! 1 GB memory leak is too much for me!

    Dear Sirs. I found that DB environment, that was configured to use 1 GB cache size, won't free it when closed! Why? First I tried to open and close environment and got the following:
    Detected memory leaks!
    Dumping objects ->
    {596} normal block at 0x01970040, 1048596 bytes long.
    Data: < > 14 00 10 00 DB DB DB DB 0B 00 10 00 01 00 00 00
    {578} normal block at 0x00397978, 464 bytes long.
    Data: < > D0 01 00 00 DB DB DB DB C7 01 00 00 01 00 00 00
    Object dump complete.
    I have and idea that BDB will reuse the memory, rite? OK, let's try to create the same environment and open it. After environment was opened, closed, opened again and again closed, I got the following:
    Detected memory leaks!
    Dumping objects ->
    {3663} normal block at 0x01B80040, 1048596 bytes long.
    Data: < > 14 00 10 00 DB DB DB DB 0B 00 10 00 01 00 00 00
    {3645} normal block at 0x00396E60, 464 bytes long.
    Data: < > D0 01 00 00 DB DB DB DB C7 01 00 00 01 00 00 00
    {596} normal block at 0x01970040, 1048596 bytes long.
    Data: < > 14 00 10 00 DB DB DB DB 0B 00 10 00 01 00 00 00
    {578} normal block at 0x00397978, 464 bytes long.
    Data: < > D0 01 00 00 DB DB DB DB C7 01 00 00 01 00 00 00
    Object dump complete.
    So memory was not reused, nor deallocated.
    By the way, you may be interested in other leak I found, but fixed, see
    Replication manager memory leak when setting local site information.
    This leak is more serious, I am not sure I will fix it quickly. Maybe I'm doing something wrong? Could you please suggest something?
    Thanks in advance!
    With regards,
    Vladislav.

    OK, the problem solved by fixing code in file 'log.c', method '__log_dbenv_refresh'.
    Just added the code that deallocates memory of bulk buffer.
    if (IS_ENV_REPLICATED(dbenv))
    if (lp->bulk_buf != INVALID_ROFF)
    __db_shalloc_free(&dblp->reginfo, lp->bulk_buf);
    lp->bulk_buf = INVALID_ROFF;
    lp->bulk_len = 0;
    lp->bulk_off = 0;
    It was allocated in the '__log_open' function, by the following code:
              lp->ready_lsn = lp->lsn;
              if (IS_ENV_REPLICATED(dbenv)) {
                   if ((ret = __db_shalloc(&dblp->reginfo, MEGABYTE, 0,
                   &bulk)) != 0)
                        goto err;
                   lp->bulk_buf = R_OFFSET(&dblp->reginfo, bulk);
                   lp->bulk_len = MEGABYTE;
                   lp->bulk_off = 0;
              } else {
                   lp->bulk_buf = INVALID_ROFF;
                   lp->bulk_len = 0;
                   lp->bulk_off = 0;
    Sorry for time taken to read my posts, I was really needy in quick help, but solved problems myself.

Maybe you are looking for