Why do I get a memory leak when I use the Write Data Storage VI in a loop

I have a large application that I am collecting various data points from. For the most part they are simple scalar values that need to be logged on a regular basis.  I was attempting to use the new TDM files and the storage VI's  I though everything was working until I looked at the taskmanager and noticed that when the logging loop ran my CPU eventually went to 100% and the process memory grew from about 80,000K to 100,000K and eventually locks up the system. 
I am using a state machine arch. 
State 1 - open file (open create) mode) 
State 2 - Write Channel Group Properties
State 3 - Loop writes 24 distinct data points to a TDM files in append mode
State 3 - Repeats [creating new rows of the same 24 data point (wait time about 1 sec)]
State 4 - Close file on exit.
Any help on this problem would be appreciated.

The way I see it, it should be this way.
Message Edited by Pana-man on 09-30-2005 08:15 PM
Message Edited by Pana-man on 09-30-2005 08:18 PM
Paul <--Always Learning!!!
sense and simplicity.
Browse my sample VIs?
Attachments:
nextWeek.jpg ‏43 KB

Similar Messages

  • Why do I get a blue screen when I use the NIDAQ driver.

    I get IRQL_NOT_LESS_OR_EQUAL.
    Address fc792324 has base at fc6f8000 Nidaq32.sys and Address fc7028e3 has base at fc6f8000 Nidaq32.sys.
    The system is running on Windows NT 4.0. The application is built using Application Builder and LabView 5.1.1. The NIDAQ 6.9.0 is used.
    Please help me.

    uffe:
    You seek...Yoda...Help you...I...will..
    This is a kernel mode problem with your NIDAQ32.SYS driver. I believe
    that you can pretty much rule out problems with LV5.1.1 or app
    builder. Your problem
    You have run into a classic BSOD message. It may not always occur so
    it can be really frustrating to diagnose. There may be some
    workarounds you can implement at the application level but it still
    needs to be fixed at the kernel (O/S) level so you're going to need to
    contact NI.
    I've had this same problem error message in the past but not with DAQ
    cards. As I recall, in one case there was a problem with a spinlock
    in the SCSI driver (.sys) file which protected access to the hardware
    I was using.
    What is a spin lock? A spin lock is a special synchronization
    construct used by device driver developers to protect access to
    critical sections of their code usually for hardware access. It is
    the kernel mode equivalent to a VISA resource lock or a semaphore in
    LabVIEW.
    For more on spin locks see:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmarch/hh/kmarch/k101_97hu.asp
    Work-around Possibility #1: Do you have two different parts of your
    code trying to access the DAQ card simultaneously? If so, providing
    your own VISA resource locks or semaphores at the application level
    may cure the problem even if the kernel mode driver is failing to
    protect access to the card like it should.
    Even if this fixes the problem PLEASE report it to NI so that they can
    fix it properly in the .sys file and let other users know that the
    workaround I suggested works.
    See:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/network/hh/network/103ndisx_7mk2.asp
    Work-around Possibility #2: I don't know the details of setting up
    your DAQ card so if this question doesn't make any sense don't worry
    about it. Are you setting up the card with some empty array, zero
    memory size, or empty string value or something? I had this problem
    with a reflective memory card driver.
    Sometimes this can screw up a driver that isn't checking for this sort
    of thing with the result of it trying to reference a null ptr or
    something. Again, even if you fix the problem by error checking the
    values before you give them to the DAQ driver VI, make sure you tell
    NI about it.
    This explanation also jibes with what Microsoft has to say on
    IRQL_NOT_LESS_OR_EQUAL. See:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/w2kmsgs/6077.asp
    3) There may be other explanations for your problem but these are two
    that I've run into personally. Try going to www.microsoft.com and
    doing a search on IRQL_NOT_LESS_OR_EQUAL if my two possibilities
    aren't the cause of your problem.
    4) Make sure you have the latest driver from NI for the NIDAQ. NI may
    have already fixed your problem in a later version of the NIDAQ
    driver.
    5) Also I would recommend making sure that you have the latest service
    pack (SP6A) installed or that you go ahead and upgrade to Win2000. As
    I recall when I had my one of my driver problems it was with an
    earlier SP release and upgrading SP's helped.
    6) If none of these suggestions help, you need to call NI help line
    (800-IEE-E488) and report this to see if they know about it so that
    they can give you a work around and see if they can recreate the
    problem and then fix it.
    Doug De Clue
    LabVIEW developer
    [email protected]
    uffe wrote in message news:<[email protected]>...
    > I get IRQL_NOT_LESS_OR_EQUAL.
    > Address fc792324 has base at fc6f8000 Nidaq32.sys and Address fc7028e3
    > has base at fc6f8000 Nidaq32.sys.
    >
    > The system is running on Windows NT 4.0. The application is built
    > using Application Builder and LabView 5.1.1. The NIDAQ 6.9.0 is used.
    >
    > Please help me.

  • Why do I get a foggy picture when I  use my flash on my phone

    Why does my iphone have foggy pictures when I use my flash?

    If you are using a protective case on your iPhone, make sure it is not interfering with the flash.

  • Since loading IOS7 i get a crackling sound when I use the ipad to video something

    When I video something now i get a crackling sound when I replay the video. From reading some sites it seems the problem comes from the time I downloaded tge latest ios7 update. I an trying to find out how to recover from this problem

    Hey 24DubliN,
    Thanks for the question. I understand that you are experiencing issues with your iPad 2 in relation to sound. To troubleshoot the microphone on your device, see the following resource. While titled for iPhones, most of the steps are applicable for your iPad as well:
    iPhone: Microphone issues
    http://support.apple.com/kb/TS5183
    Thanks,
    Matt M.

  • 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

  • Why do i get a white screen when i lift the display screen

    when i lift the screen to log in to an account a get a 'white screen'  the machine does not respond to any key(s).  If I held doden the power button, I can re-boot and all is fixed untill the next time....   Maybe once a month this happens?

    Hello, NickNE. 
    I would recommend trying the steps in the articles below as they may help with the display issue you are experiencing.
    Intel-based Macs: Resetting the System Management Controller (SMC)
    http://support.apple.com/kb/ht3964
    About NVRAM and PRAM
    http://support.apple.com/kb/ht1379
    Cheers,
    Jason H.

  • Why do I get a plus sign " " when I hit the space bar?

    This problem comes and goes and seemed tohave started when I typed something into the search bar on Safari.

    This thread is thirty months old and outdated; you have no products listed in your profile and so we cannot be sure what machine or version of it you are using.
    Please supply more detail and include this in a new question.
    Thank you.

  • Can someone tell me how or why I'm getting an error message when I download the itunes update.

    Hi.  The download for the itunes update gives me an error 7 windows 193. How do I fix that?

    Well, first, if you want help for an iTunes problem, you shouldn't post in the iPad forum. :-)
    I've asked that your post be relocated to the appropriate forum.
    This should answer your question. http://support.apple.com/kb/TS3074

  • Why is up next adding songs twice when I use the keyboard shortcut? (windows)

    I only encounter this using the mini-player
    as far as I know, at least; because the keyboard shortcut doesn't even work on the full sized player.
    augh.

    You should post that on the Boot Camp  forum, that is where all the Boot Camp and Windows guys hang out.
    Good luck.

  • Why do we gor for SAP BW rather than using the other Data Warehouse S/W's

    Hi All,
    Can any one tell me Why do we especially go for SAP BW, rather than other Warehouse S/W's available in the IT Market.
    Plzzzz..... Reply back me to [email protected]
    Regards,
    Kiran

    Hello Kiran Telkar,
    How r u ?
    1. Multi Dimentional Modelling Concept is available in BW
    2. Most of the 3rd party DataBases could be connected to BW
    3. Very effective Reporting Solution is given by BW
    4. Integration of Transactional Data & Master Data
    5. Tight integration with R/3 and the Business Content functionality, which handles core areas & processes.
    and more !
    Best Regards....
    Sankar Kumar
    +91 98403 47141

  • Memory Leak when I get the SP return refcursor by oracle ODBC driver:

    Oracle server:&#65320;&#65328;&#65293;&#65333;&#65358;&#65353;&#65368;
    Oracle Version: 9.2.0.6.0
    Application Server: windows2003
    Develop tool &#65306; VC++;
    Question:
    when I get the return refcursor by OLEDB.Oracle, there is not any memory leak and work well. But when I change the driver to ODBC “Oralce in OraHome92"
    there will be an 56k memory leak.
    And in the other hand if I call an store precedure without return ref. Both driver /way can work well.
    Can you give me the advice? thanks a lot.
    Code such as:
    _ConnectionPtr m_AdoConnection;
    _CommandPtr pcmd = NULL;
    _RecordsetPtr sp_rs = NULL;
    _bstr_t bstrConstruct = _bstr_t("DSN=test;Uid=test;Pwd=test;PLSQLRSet=1");
    HRESULT hr = CoCreateInstance(__uuidof(Connection),NULL,CLSCTX_INPROC_SERVER,__uuidof(_ConnectionPtr),(LPVOID *)&m_AdoConnection);
    if (FAILED (hr) ) throw hr ;
    m_AdoConnection->PutCursorLocation(adUseClient) ;
    m_AdoConnection->IsolationLevel = adXactSerializable;
    m_AdoConnection->Mode = adModeShareExclusive;
    bstr_t bstrEmpty(L"") ;
    m_AdoConnection->Open (bstrConstruct, bstrEmpty, bstrEmpty, -1) ;
    SAFE_CALL(m_spObjectContext->CreateInstance(__uuidof(Command),__uuidof(_CommandPtr),(LPVOID *)&pcmd));
    if(pcmd == NULL)
    throw CAtlExceptionEx(E_POINTER,"pcmd is NULL");
    pcmd->CommandText = _bstr_t(L"wec_pkg_spl.wec_proc_spl_check");
    pcmd->CommandType = adCmdStoredProc;
    _bstr_t id = _bstr_t("65650000");     
    pcmd->Parameters->Append(pcmd->CreateParameter(_bstr_t(L"id"),DataTypeEnum(adVarChar),adParamInput,2000,_variant_t(id)));          
    pcmd->Parameters->Append(pcmd->CreateParameter(_bstr_t(L"errcode"),DataTypeEnum(adNumeric),adParamOutput,4));
    pcmd->Parameters->Append(pcmd->CreateParameter(_bstr_t(L"errdescription"),DataTypeEnum(adVarChar),adParamOutput,2000));
    pcmd->ActiveConnection = sp_con.m_AdoConnection;
    sp_rs = pcmd->Execute(NULL,NULL,adCmdStoredProc);
    pcmd->Release;          
    sp_rs->Close();     
    if (m_AdoConnection->State == adStateOpen)
    m_AdoConnection->Close();
    wec_pkg_spl.wec_proc_spl_check arguments:
    id          varchar2     in
    flowpaths     ref cursor     out
    errcode          number          out
    errdescription     varchar2     out
    Message was edited by:
    [email protected]

    I'm using the oracle ODBC driver 8.05.10 with MFC and client version 8.0.5. In my experience you can't prevent memory leaks with that or earlier versions of the ODBC driver. Client patchkits or service packs for NT or the Visual Studio doesn't solve the problem.
    The following code will result in a memory leak with the oracle driver. With every expiration of the timer the leak will grow.
    void CTestOdbcOracleDriverDlg::OnTimer(UINT nIDEvent)
    TCHAR errString[255];
    //open the database with class CDatabase
    //use of CRecordset
    TRY {
    //my table name is AL_ALARME_LOG
    pMyRecordset->Open(CRecordset::dynaset,"SELECT * FROM AL_ALARME_LOG",CRecordset::none);
    //do something with the data
    Sleep(0);
    pMyRecordset->Close();
    CATCH_ALL(error) {
    error->GetErrorMessage(errString,255);
    DELETE_EXCEPTION(error);
    END_CATCH_ALL
    CDialog::OnTimer(nIDEvent);
    The same code with the Microsoft ODBC driver
    doesn't cause memory leaks.
    Andreas ([email protected])

  • Memory leak when using DB_DBT_MALLOC in CDB.

    Hello!
    Recently when I'm using Berkeley DB CDB and set the value Dbt DB_DBT_MALLOC, I noticed that the app's memory keeps growing during the db.get while;
    I found that many codes on the internet use the syntax free(value.get_data()), but when I tried to free the value.get_data(), I always got an interruption error.
    It's OK when I'm using the DB_DBT_USERMEM flag. So I just get very confused about the DB_DBT_MALLOC and DB_DBT_REALLOC.
    And also, I wonder why there's no memory leak problem when we use the single thread BDB. I think BDB cannot free the value.data pointer too in single thread before the app finish using it, then why our apps don't need to free the data afterwards?
    Thanks a lot in advance!

    You should use free() to free the DBT memory allocated via DB_DBT_MALLOC. You should do that after each Db::get() operation (and of course after finishing processing/using the data), otherwise you will loose the pointer to the memory previously allocated if you happen to reuse the DBT with DB_DBT_MALLOC (the data field will point to a new memory address).
    Alternatively you could use DB_DBT_REALLOC or DB_DBT_USERMEM.
    Note that there are small structures that BDB creates in the environment regions that only get freed/cleaned when the environment is closed.
    If you suspect that there is a memory leak inside the BDB code, make sure you rebuild Berkeley DB using the following configuration options (along with the others you use) when building: enable-debug, enable-umrw. Than, run the program under a memory leak detection utility, like Valgrind (allow the application to open and close the BDB environment) and see if there are any leaks reported.
    If memory leaks are reported, then put together a small stand-alone test case program that demonstrates the leaks, and post it here.
    Regards,
    Andrei

  • Memory leak when transferring files Lion

    hi all, help   I'm experiencing a memory leak since upgrading to Lion when transferring shared files between my macbook pro and imac. This occures through ethernet (wireless/wired) and firewire 800. No other apps are open except activity montior and finder. I am trying to transfer about 100g of itunes music / video files and pictures. Time machine backups to my TC do not have this affect.
    When transfer starts the free memory slowly decreases whilst the inactive memory increases. Eventually the free memory drops below 10mg, active memory is approx 5-6gb and wired/active is about 2gb. Bascially as the free memory decreases the inactive memory increases however does not get realocated so the mac grinds to a halt and dies with lots of page outs etc.
    this only happens when trying to transfer files. I have tried whole folders and just small individual ones and noticed the same event. I am struggling to find the cuase of the problem - any ideas?
    mac os x 10.7.1
    processor 2.53 GHz Intel Core i5
    Memory 8 GB 1067 MHz DDR3
    cheers, Kevin

    I dont think you have a memory leak. I think the problem is the xml file is 1000000 records long and takes up too much memory. Even if you find a way to increase memory size, you are loading down the server too much for other people's applications to run. I suggest instead reading up on xml and learning how to read in only a few records at a time, processing it, and getting the next set of records to process. There are two methods to parse an xml file using an xml parser, one is to parse it all and put it in memory, the other is to process one record at a time (an xml book explains it better).
    However, I question why you have reports that are 1000000 records long. end-users cannot effectively use such records (you cant scroll through 1000000 records). I suggest finding a way to greatly decrease the number of records in each file such as by providing just the records a particular user needs to do his job and not all records. For instance, put a textfield on his screen to let him only fetch records within a certain date range.
    Lastly, I suggest putting your code in a try/catch/finally block where the finally block actually closes the objects. Example:
    finally{
    if(conn!=null)
    conn.close();
    }

  • Memory leak when transferring pdf...help needed

    Dear All,
    I'm a newbie in developing java app. I'm making a web based application in reporting using JSP. java 1.6.02, jasper report 204, i-report 2.0.0
    Client : OS : Win xp, memory 512MB
    Server : Tomcat 6.0
    DB Server : SQL Server 2005
    OS Server : Windows Server 2003, memory 1GB
    Report spec : .pdf based, with up to 1million record
    Here's the code :
    String query;
            try {
            String filereport = request.getRealPath("division/accounting/template/POReport.jrxml");
            InputStream input = new FileInputStream(filereport);
            Class.forName(odbcDriver);
            Connection conn = DriverManager.getConnection(odbcURL,username,passwd);
            ResultSet rset = null;
            CallableStatement cs = null;
            query = "{ call sp_tpo_list }";
              cs = conn.prepareCall(query);
              rset = cs.executeQuery();
            JRDataSource dataSource = new JRResultSetDataSource(rset);
            JasperDesign design = JRXmlLoader.load(input);
            JasperReport report = JasperCompileManager.compileReport(design);
            JasperPrint print = JasperFillManager.fillReport(report, null, dataSource);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            JasperExportManager.exportReportToPdfStream(print, baos);
            response.setContentType("application/pdf");
            response.setContentLength(baos.size());
            ServletOutputStream sos;
            sos = response.getOutputStream();
            baos.writeTo(sos);
            sos.flush();
            rset.close();
            cs.close();
            conn.close();
            sos.close();
            baos.close();
            input.close();      
            catch (FileNotFoundException fe) {}
            catch (JRException jre) {}
            catch (ClassNotFoundException cnfe) {}
            catch (SQLException sqle) {} 
            catch (IOException ioe) {}I've already increase heap memory in Tomcat Manager -Xms 64Mb -Xmx 512Mb.
    But when i test with 1million record, out of heap memory error is coming out.
    When i test with 500.000 record, it work out, but only when 1 client access. More than 1 client, out of heap memory error generated by the system.
    How can this happen? How can i detect memory leaks occured in the program?
    And pls let me know if you see something is missing in the code above.
    Thank you

    I dont think you have a memory leak. I think the problem is the xml file is 1000000 records long and takes up too much memory. Even if you find a way to increase memory size, you are loading down the server too much for other people's applications to run. I suggest instead reading up on xml and learning how to read in only a few records at a time, processing it, and getting the next set of records to process. There are two methods to parse an xml file using an xml parser, one is to parse it all and put it in memory, the other is to process one record at a time (an xml book explains it better).
    However, I question why you have reports that are 1000000 records long. end-users cannot effectively use such records (you cant scroll through 1000000 records). I suggest finding a way to greatly decrease the number of records in each file such as by providing just the records a particular user needs to do his job and not all records. For instance, put a textfield on his screen to let him only fetch records within a certain date range.
    Lastly, I suggest putting your code in a try/catch/finally block where the finally block actually closes the objects. Example:
    finally{
    if(conn!=null)
    conn.close();
    }

  • Memory Leak when running Contacts

    I am having a big memory leak when running the app Contacts on a MB Air. It gobbles up 2 GB of ram in just a few minutes forcing a reboot. I have re-installed Mountain Lion 10.8.2 and it still leaks memory. Watching Activity Monitor shows the rapid increase in Ram being gobbled up by Contacts. Used Mackeeper to clear cache as well as ran Cocktail, all to no avail. Any tips would be greatly appreciated.

    The size of oracle.exe is not an indication of how the Java VM GC works; so you are not comparing apples to apples. It'll be too long to explain here but in my upcoming book (see hereafter), I gave a detailled explanation of the various memory areas the Java VM uses and how these are GCed and also how you can meausre their size (not all, though).
    In short you want to use OracleRuntime methods such as
    OracleRuntime.getSessionSize(); --> get he current size of Sessionspace
    OracleRuntime.getNewspaceSize(); --> get he current size of Newspace
    there are other memory areas described in the book
    http://www.oracle.com/technology/pub/articles/mensah_dws.html
    http://www.elsevier.com/wps/find/bookdescription.cws_home/706089/description#description
    Sample chapter: http://www.oracle.com/technology/books/pdfs/mensah_ch1.pdf
    Kuassi

Maybe you are looking for

  • How to create a text which can support more than 500 chars ?

    Hi all:     In my interactive form, I have one text, the value inside this text is longtext, the length will be more than 500 chars.     My problem is now , if there is more than 100 chars, there will be duplicated chars in this text.     Can I make

  • Photos and iCloud

    I am getting a new phone and want to back up my phone to iCloud, but it looks like my photos are not being saved on iCloud. I know that new photos are kept when I turn on photo stream, but what about my old photos that are not on photo stream?

  • Download All Photos With One Click

    Is there a way in iWeb to download all the photos on a photo page in 1 click? Similar to the way you can download an entire Gallery on MobileMe.

  • Process chain - schedule for certain days

    Hello all, How can I schedule a process chain that : -should run 3 times per day -between the 8th and the 12 workingday of a month Any sugesstions? Thank you.

  • Cannot Sync iPhone Video back to iPhone

    Alright, so I took some video on my iPhone 3GS. As part of my normal archiving process, I have all photos and videos from the iPhone automatically imported into a specific album ("iPhone Album") in Adobe Photoshop Elements 7 upon connecting my iPhone