Getting memory leak in OCCI

these are the chunks from the file I made through valgrind a memory check software.
these are the kind of leak or error you could say; that were reported by the software or a library to check memory leaks if u want i could send you the whole file please help
==22982== Memcheck, a memory error detector for x86-linux.
==22982== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==22982== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==22982== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==22982== For more details, rerun with: -v
==22982==
==22982== Syscall param times(buf) contains unaddressable byte(s)
==22982== at 0x1E4522: times (in /lib/tls/libc-2.3.4.so)
==22982== by 0x1BF22146: kghinp (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BB6FBA6: kpuinit0 (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BB6EED9: kpuenvcr (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==22982==
==22982== Invalid read of size 16
==22982== at 0x1C8E9B18: (within /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libnnz10.so)
==22982== Address 0x1CA35F60 is 112 bytes inside a block of size 127 alloc'd
==22982== at 0x1B904984: malloc (vg_replace_malloc.c:131)
==22982== by 0x1BE1E6B5: nlpainzert (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BE1D3B7: nlpaparse (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BE1E513: nlpardfile (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982==
==22982== Use of uninitialised value of size 16
==22982== at 0x1C8E988E: (within /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libnnz10.so)
==22982== by 0x1BDC2593: ztchn (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BDC24C1: ztch (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BDC57D5: ztcrsgstk (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982==
==22982== Use of uninitialised value of size 4
==22982== at 0x1BD79DA0: ztced_einit (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BD79EC5: ztcedgks (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BD79497: ztcedi (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BD785F7: ztcebi (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982==
==22982== Conditional jump or move depends on uninitialised value(s)
==22982== at 0x1C83BE39: CMP_OctetStringToCMPInt (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libnnz10.so)
==22982== by 0x1C82E155: Alg_ComputeModQ_GHash (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libnnz10.so)
==22982== by 0x1C837582: A_X931RandomGenerateBytes (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libnnz10.so)
==22982== by 0x1BDC4DF9: ztcr2rnd (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982==
==22982== Conditional jump or move depends on uninitialised value(s)
==22982== at 0x1BEE0BDF: kzsrepw (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BBB38B5: kpu8lgn (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BBADA00: kpuauthxa (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BBAD53E: kpuauth (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982==
==22982== Use of uninitialised value of size 4
==22982== at 0x1BD7A382: ztceai (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BD785F7: ztcebi (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BD77EC5: ztcei (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BDC65B1: ztvo5pe (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BD77F64: ztcen (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982==
==22982== Conditional jump or move depends on uninitialised value(s)
==22982== at 0x1BD79022: ztceb_unpadding (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BD788D4: ztcebf (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BD78010: ztcef (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982== by 0x1BD77D07: ztcedec (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libclntsh.so.10.1)
==22982==
==22982== Mismatched free() / delete / delete []
==22982== at 0x1B905043: operator delete(void*) (vg_replace_malloc.c:156)
==22982== by 0x1B95C23C: oracle::occi::ConnectionImpl::~ConnectionImpl() (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libocci.so.10.1)
==22982== by 0x1B95A094: oracle::occi::EnvironmentImpl::terminateConnection(oracle::occi::Connection*) (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libocci.so.10.1)
==22982== by 0x8050DE4: DBConnection::CloseEnv(DBError*) (in /home/jaka/IRIS/EXE/test.exe)
==22982== Address 0x1CA59618 is 0 bytes inside a block of size 5 alloc'd
==22982== at 0x1B904D39: operator new[](unsigned) (vg_replace_malloc.c:139)
==22982== by 0x1B95A86E: oracle::occi::ConnectionImpl::setUserName(void*, unsigned, bool) (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libocci.so.10.1)
==22982== by 0x1B95B14D: oracle::occi::ConnectionImpl::openConnection(OCIEnv*, OCIError*, void*, unsigned, void*, unsigned, void*, unsigned, void*, unsigned, unsigned) (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libocci.so.10.1)
==22982== by 0x1B95EFB5: oracle::occi::ConnectionImpl::ConnectionImpl(oracle::occi::EnvironmentImpl*, std::string const&, std::string const&, std::string const&) (in /usr/app/oracle/oracle/product/10.2.0/db_1/lib/libocci.so.10.1)
==22982==
==22982== ERROR SUMMARY: 1524 errors from 165 contexts (suppressed: 27 from 2)
==22982== malloc/free: in use at exit: 960761 bytes in 309 blocks.
==22982== malloc/free: 2699 allocs, 2390 frees, 1313176 bytes allocated.
==22982== For counts of detected errors, rerun with: -v
==22982== searching for pointers to 309 not-freed blocks.
==22982== checked 20880568 bytes.
==22982==
==22982== LEAK SUMMARY:
==22982== definitely lost: 0 bytes in 0 blocks.
==22982== possibly lost: 0 bytes in 0 blocks.
==22982== still reachable: 960561 bytes in 308 blocks.
==22982== suppressed: 200 bytes in 1 blocks.
==22982== Reachable blocks (those to which a pointer was found) are not shown.
==22982== To see them, rerun with: --show-reachable=yes
now if any body can help me removing this memory leak or is this the problem of OCCI
apparently it seems to be OCCI's library issue but i could be wrong please help
hoping to see a response
Message was edited by:
kjaka

=============================================
#include <iostream>
#include <string>
#include <vector>
#include <occi.h>
using namespace std;
using namespace oracle::occi;
int main()
     Environment* env;
env = Environment::createEnvironment(Environment::OBJECT);
     cout << "Enviorment created " << endl;
     Connection* conn;
     Statement *stmt;
     ResultSet *rs;
     vector<MetaData> vMD;
     vector<MetaData> vArgMD;
     int dataType;
     char tmpChar[1024];
     Statement::Status status;
     try
          conn = env->createConnection("iris","tpstps", "iris10gr1");
          cout << "connection created " << endl;
          stmt = conn->createStatement();
          string sStmt = "begin :1 := PKGNETWORK.spGetNetworkInfoByIP(:2, :3); end;";
          // 1st sp     
          stmt->setSQL(sStmt);
          stmt->registerOutParam(1, OCCIINT);
          stmt->setString(2,"192.168.6.12");
          stmt->setMaxParamSize(2,20);
          stmt->registerOutParam(3,OCCICURSOR);
          status = stmt->execute();
          int retVal = stmt->getInt(1);
          rs = stmt->getCursor(3);//use ResultSet to fetch rows
          vMD = rs->getColumnListMetaData();
          dataType = vMD[0].getInt(MetaData::ATTR_DATA_TYPE);
          cout << "Attribute count : " << vMD[0].getAttributeCount() << endl;
dataType=vMD[0].getInt(MetaData::ATTR_DATA_TYPE);
cout << "Attribute type : " << dataType << endl;
          cout << "Attribute name : " << vMD[0].getString(MetaData::ATTR_NAME)<< endl;
cout << "Size : " << vMD.size() << endl;
while (rs->next())
cout << "next row";
cout << "NetID : " << rs->getString(1).c_str() << endl;
          cout << " vector filled for SP1" << endl;
          cin >> tmpChar;
          vMD.clear();
          stmt->closeResultSet(rs);
          conn->terminateStatement(stmt);
          cout << "1st sp executed" << endl;
     // 2nd sp     
          string sStmt1 = "begin :1 := PKGJUNK.SpGetTblAccount(:2); end;";
          stmt = conn->createStatement();
          stmt->setSQL(sStmt1);
          stmt->registerOutParam(1, OCCIINT);
          stmt->registerOutParam(2,OCCICURSOR);
          status = stmt->execute();
          retVal = stmt->getInt(1);
          rs = stmt->getCursor(2);//use ResultSet to fetch rows
          int loop = 1;
          vMD = rs->getColumnListMetaData();
          dataType = vMD[0].getInt(MetaData::ATTR_DATA_TYPE);
          cout << "Attribute count : " << vMD[0].getAttributeCount() << endl;
dataType=vMD[0].getInt(MetaData::ATTR_DATA_TYPE);
cout << "Attribute type : " << dataType << endl;
          cout << "Attribute name : " << vMD[0].getString(MetaData::ATTR_NAME)<< endl;
cout << "Size : " << vMD.size() << endl;
while (rs->next())
cout << "next row";
cout << "NetID : " << rs->getString(1).c_str() << endl;
          stmt->closeResultSet(rs);
          cout << "2nd sp executed" << endl;
          conn->terminateStatement(stmt);
          // sp-3     
          string sStmt2 = "begin :1 := PKGONELINK.spValidateAccount(:2,:3,:4,:5,:6); end;";
          stmt = conn->createStatement();
          stmt->setSQL(sStmt2);
          stmt->registerOutParam(1, OCCIINT);
          stmt->setString(2,"37863 ");
          stmt->setMaxParamSize(2,100);
          stmt->registerOutParam(3,OCCISTRING, 20);
          stmt->registerOutParam(4,OCCISTRING, 2);
          stmt->registerOutParam(5,OCCISTRING, 3);
          stmt->registerOutParam(6,OCCISTRING, 3);
          status = stmt->execute();
          cout << "3rd sp executed" << endl;
          conn->terminateStatement(stmt);
          conn->flushCache();
          env->terminateConnection(conn);
          vMD.clear();
     cout << "Demo completed...data deleted" << endl;
          cin >> tmpChar;
     catch (SQLException &ex)
{//cleanup
          cout << "Error, cleaning up..." << ex.getMessage() << endl;
     conn->terminateStatement(stmt);
     env->terminateConnection(conn);
     cout << "terminating env" << endl;
     Environment::terminateEnvironment(env);
// throw;//will be caught by outer handler
     Environment::terminateEnvironment(env);
     return 0;
===================================================
this is not the same program but still this program gives the same amount of memory leak, this memory leak is reported in each program that uses OCCI
this program was made with the help of the sample program posted at the OTN website
"Calling PLSQL functions/procedures";
hoping for a reply soon

Similar Messages

  • Memory leak in occi

    Hi ,
    I am working in Solaris 9 x86, with Oracle installed on it.I am getting memory leaks reported in occi library.
    Machine Details:
    Hostname: ALEXANDER
    Hostid: 2ed11ae9
    Release: 5.9
    Kernel architecture: i86pc
    Application architecture: i386
    Hardware provider:
    Domain:
    Kernel version: SunOS 5.9 Generic 112234-10 Nov 2003
    Database Version :
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Compiler Version:
    CC: Sun C++ 5.5 Patch 113819-09 2004/08/03.
    Compiler arguments:
    CC -w -g Main.cpp -I$ORACLE_INCLUDE -o Main -lclntsh -locci
    I started with the demo apps for occi that comes with Oracle.
    After running the executables and checking with the bcheck utility I receive the errors due to memory leak.
    bcheck -all ./Main
    Actual leaks report (actual leaks: 2 total size: 43 bytes)
    <rtc> Memory Leak (mel):
    Found leaked block of size 31 bytes at address 0x812d6f8
    At time of allocation, the call stack was:
         [1] operator new() at 0xd7906718
         [2] operator new[]() at 0xd7905ab8
         [3] oracle::occi::StatementImpl::do_setSQL() at 0xda13e681
         [4] oracle::occi::StatementImpl::StatementImpl() at 0xda13e1bf
         [5] oracle::occi::ConnectionImpl::createStatement() at 0xda136863
         [6] occidml::executeSelectStatement() at line 46 in "Main.h"
         [7] main() at line 12 in "Main.cpp"
    <rtc> Memory Leak (mel):
    Found leaked block of size 12 bytes at address 0x8084c40
    At time of allocation, the call stack was:
         [1] operator new() at 0xd7906718
         [2] std::vector<OCIParam*,std::allocator<OCIParam*> >::__insert_aux() at 0xda145c19
         [3] std::vector<OCIParam*,std::allocator<OCIParam*> >::resize() at 0xda145443
         [4] oracle::occi::StatementImpl::initParamVec() at 0xda144e70
         [5] oracle::occi::ResultSetImpl::next() at 0xda146404
         [6] main() at line 15 in "Main.cpp"
    If any body needs more info , pls send me your email address so that I can send my source files.

    can you post this in the OCCI forum?

  • Memory leak in OCCI/libclnts on Linux RHEL 5.5 ? Please advise...

    Hi all,
    Starting with some background:
    I have an application that has been running on 32-bit Linux server for years without problem, a few weeks ago it was ported to 64-bit RHEL 5.5 (compiled with -m32). Now with the application in the new environment some processes are growing in memorysize.
    I have tried to pinpoint the memory leak with Valgrind and have numerous leaks reported in "libclntsh.so", "libocci.so" and "libnnz11.so"
    Examples:
    ==30114== Use of uninitialised value of size 4
    ==30114== at 0xA61BAD7: ztcedecb (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0xA61B1E2: ztcedencbk (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0xA61AA0A: ztcebn (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0xA61A561: ztcen (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8DA9725: ztceenc (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E68920: ztcrbm (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E684D5: ztcrbh (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E68393: ztcrbp (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E682C6: ztcr2seed (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E6827F: ztcrseed3 (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8DAA24A: ztcsh (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x99727D7: kpucpcreate (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    And:
    ==30114== Conditional jump or move depends on uninitialised value(s)
    ==30114== at 0x8E69BBC: ztvo5ke (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8D55E68: kpu8lgn (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8D53E56: kpuauthxa (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8D536DB: kpuauth (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x996EB99: kpucpinithstnode (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x996FFB1: kpucpcrecons (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x9972871: kpucpcreate (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x9821048: OCIConnectionPoolCreate (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x7BFB896: oracle::occi::ConnectionPoolImpl::initialise(oracle::occi::EnvironmentImpl*, void*, unsigned int, void*, unsigned int, void*, unsigned int, unsigned int, unsigned int, unsigned int) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BFBB79: ZN6oracle4occi18ConnectionPoolImplC9EPNS015EnvironmentImplERKSsS5_S5_jjj (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BFBAC7: oracle::occi::ConnectionPoolImpl::ConnectionPoolImpl(oracle::occi::EnvironmentImpl*, std::string const&, std::string const&, std::string const&, unsigned int, unsigned int, unsigned int) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BF2C13: oracle::occi::EnvironmentImpl::createConnectionPool(std::string const&, std::string const&, std::string const&, unsigned int, unsigned int, unsigned int) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    And:
    ==30114== Conditional jump or move depends on uninitialised value(s)
    ==30114== at 0xAC3B2A5: CMP_RecomputeLength (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0xAC3B9EC: CMP_Divide (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0xAC3B5BA: CMP_ModularReduce (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0xAC3A2E6: Alg_ComputeModQ_GHash (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0xAC3AA30: A_X931RandomGenerateBytes (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0x8E681F0: ztcr2rnd (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8DAA260: ztcsh (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8CD0125: kpusattr (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8CE96CD: OCIAttrSet (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x7BF6184: oracle::occi::ConnectionImpl::openConnection(OCIEnv*, OCIError*, void*, unsigned int, void*, unsigned int, void*, unsigned int, void*, unsigned int, unsigned int, void*, unsigned int, oracle::occi::Connection::Purity, oracle::occi::StatelessConnectionPool::PoolType) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BF9C29: ZN6oracle4occi14ConnectionImplC9EPNS018ConnectionPoolImplERKSsS5_ (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BF9AD1: oracle::occi::ConnectionImpl::ConnectionImpl(oracle::occi::ConnectionPoolImpl*, std::string const&, std::string const&) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    There has been quite a few changes due to the new server. New compiler (gcc) from version 2.96 to 4.1.2, new version of oracle client 10g to 11g (11.2.0.2), new version of OCCI (also 11.2.0.2). The applications sourcecode is pretty much unchanged though, and that is why I turn to all of you for help.
    Is there anyone who knows anything about this problem and how to even start to fix this leak (if it even is in OCCI)?
    I can supply sourcecode and/or logs if needed. It is quite a lot of complex code so it might take me a while to sort out the relevant code though...

    Thanks for your input! Tough this post is from some time ago this is still an issue for me I'm afraid, so I appreciate all the help I can get.
    I have stripped down the code to just the basic functions needed to replicate the problem. The pool creation and connections are the same as in our application (which is unchanged since before the porting). Though the following code makes no indications of a leak when run through Valgrind, it still grows when checked in "top". It could be that I stripped the code too much, but this is pretty much what our application does. It creates a database lock (not in this code), creates connection, (read table), terminates connection and release lock every 6 seconds to check if there is any new assignments added...
    #include <iostream>
    #include <string>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    Environment *env;
    ConnectionPool *connPool;
    Connection *con;
    int x, loopnr;
    string usr = "test_user";
    string pwd = "test_pw";
    string url = "dbtest";
    void run(int x) { // Run loops
    for(int i=0; i<x; i++){ // Loop connect and disconnect x number of times
    try {
    fflush(stdout); // Update console row for count value
    con = connPool->createConnection (usr, pwd); // Connect
    usleep(100000);
    connPool->terminateConnection (con); // Disconnect
    cout << "\r"; // Update console row for count value
    cout << loopnr << endl; // Print number of loops done
    usleep(100000);
    loopnr++; // Count number of loops done
    catch(SQLException ex) { // Exception handling
    cout<<"SQLException"<<endl;
    cout<<"Error number: "<< ex.getErrorCode() << endl;
    cout<<ex.getMessage() << endl;
    int main(int argc,char* argv[]) {
    cout << "IN --- main()\n";
    if(argc == 2) { // Read number of loops as argument...
    x = atoi(argv[1]);
    else { // ...or run loop 200 times if no args
    x = 200;
    try{
    env = Environment::createEnvironment (Environment::DEFAULT); // Create environment
    loopnr = 1;
    connPool = env->createConnectionPool(usr, pwd, url, 1, 2, 1); // Create pool
    run(x); // Run loops
    catch(SQLException ex) { // Exception handling
    cout<<"SQLException"<<endl;
    cout<<"Error number: "<< ex.getErrorCode() << endl;
    cout<<ex.getMessage() << endl;
    env->terminateConnectionPool (connPool); // Cleanup Pool when done
    Environment::terminateEnvironment (env); // Cleanup Environment when done
    cout << "\nUT --- main()\n";
    return 0;
    Above code is built with the following makefile:
    ORACLE_HOME=/opt/oracle/product/32bit-client-11.2.0.2
    CXXFLAGS = -Wall -m32 -g -fPIC \
    -I$(ORACLE_HOME)/rdbms/public
    LDLIBS = -L$(ORACLE_HOME)/lib/ -locci \
    -L$(ORACLE_HOME)/rdbms/lib/ -lclntsh
    LDFLAGS = -m32
    default: all
    Sample: Sample.cc
    all: Sample
    clean:
    rm -f Sample *.o
    Hopefully someone can make sense out of this....
    Edited by: StLa on 2011-nov-23 04:57

  • Memory Leak in OCCI library

    Hi,
    I am using OCCI library and oracle XE. There is noticeable amount memory leak in CreateEnvironment and CreateConneaction API funtions. I am not sure whether it is known problem. If the oracle server is down my application has to retry several times using these above mentioned methods and memory grows significantly.
    Here is a simple program which creates environment and create connection and terminates immediately in a while loop. We see huge memory leak.
    I have downloaded occi_gcc343,
    Here is sample program which i tried.
    #include <iostream>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    int main(int argc, char* argv[])
    Environment *env = NULL;
    Connection *conn = NULL;
    while(1)
    Environment *env  = Environment::createEnvironment(Environment::DEFAULT);
    Connection *conn = env->createConnection ("cvo","cvo123","XE");
    sleep(3);
    env->terminateConnection (conn);
    Environment::terminateEnvironment(env);
    getchar();
    return 0;
    Please let me know if there is any patch available or is there anyway overcome from this problem.
    Thanks,

    Can't really speak about the memory leak issue that you suspect with the library, but do note that that you do not need to terminate the environment in a reconnect loop. terminateEnvironment is meant to be called at program exit, not disconnect. This may help with the memory issue somewhat.

  • Why do I get Memory Leaks in case 1, but not in case 2?

    I recently investigated into memory leaks, since we got some when a Window is opened/closed several times.
    I discovered the following behavior with ListView:
    If I make several instances of a Window, which contains a ListView which uses a fix list as items, there are leaks. (Case 1)
    If I make several instances of the ListView directly there are no leaks. (Case 2).
    For me both cases seems equal, there's just another wrapper (the window) around the ListView in case 1.
    Can someone explain what's going on?
    import javafx.application.Application;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.scene.Scene;
    import javafx.scene.control.ListView;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class TestApp3 extends Application {
        public static void main(String[] args) throws Exception {
            launch(args);
        ObservableList<String> items = FXCollections.observableArrayList("Item1", "Item2");
        public void start(final Stage stage) throws Exception {
            VBox root = new VBox();
            for (int i = 0; i < 100; i++) {
                SubStage subStage = new SubStage(); // Case 1
                subStage.show();
                subStage.hide();
    //            ListView<String> listView = new ListView<String>(); // Case 2
    //            listView.setItems(items);
            System.gc();
            System.out.println((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 + " KB");
            Scene scene = new Scene(root);
            stage.setScene(scene);
            stage.show();
        private class SubStage extends Stage {
            public SubStage() {
                ListView<String> listView = new ListView<String>();
                listView.setItems(items);
                Scene scene = new Scene(listView);
                setScene(scene);
    }EDIT: If I use a TableView in the Substage, there are NO leaks. So is this an issue of the ListView?
    Edited by: csh on 10.09.2012 07:40

    There is file activity if Open Config Data.vi is being called.  The error is just due to not being able to find the configuration/.ini file.  Root cause could be a few things: the INI file was deleted/not moved/invalid path/whatever.  And the "create file if necessary" input to your use of Open Config Data.vi must be set to False for whatever reason.
    Side note:
    There were a couple changes to the Config VI's between v6 and v7.
    If you were relying on using the default FALSE in Close Config Data.vi in LV6.1, you have to change your code.
    From LV7 Upgrade Notes:
    <snip>
    • The configuration file path input of the Open Config Data VI is a required input. You must specify the configuration file path even if you open a reference to a configuration data object.
    • The default of the write configuration file? input of the Close Config Data VI is TRUE. In LabVIEW 6.1 and earlier, the default is FALSE.
    <snip>
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."
    Attachments:
    OpenConfigData_v7Help.jpg ‏19 KB

  • How to configure license file for Memory Leak tool and WL Server 9.2?

    (I posted to general JRockit forum before realizing existence of this forum which is probably more applicable.)
    Here's our problem:
    Running latest version of WL 9.2 MP3 and JRockit Mission Control 3.0.1
    Able to run Mission Control, and connect to the WL Server and to run View Console with no problems.
    I can't get Memory Leak tool to run because it complains about needing a license file.
    First I tried with off the shelf WL 9.2 MP3.
    Get error:
    A license for Memory Leak Detector could not be found on the JRockit at (1.5) weblogic.Server (192).
    Error: Can not find component Memory Leak Detector for JRockit * in the license file. Please check http://www.jrockit.com/license for license updates.
    So I downloaded license file from JRockit download site - wls92.zip. It contains several files, but no clear instructions on what to do with these files. I copied one of these files "LIC-WLSP92.txt" to my JRockit home as C:\bea\JROCKI~1\jre\license.bea
    Tried again. Restarted WL server. Restarted JRockit Mission Control.
    Get error: A license for Memory Leak Detector could not be found on the JRockit at (1.5) weblogic.Server (3052).
    The license file does not exist at: C:\bea\JROCKI~1\jre\license.bea
    Any advise on how to install license or who to contact for help?

    Installed Mission Control 3.0.3.
    Got following message when I attempted to run Memory Leak:
    A license for Memory Leak Detector could not be found on the JRockit at (1.5) weblogic.Server (192).
    Error: Can not find component Memory Leak Detector for JRockit * in the license file.
    Please check http://www.jrockit.com/license for license updates.
    I believe that we're using the latest downloads of WebLogic 9.2.x and JRockit.
    WebLogic is running using 9.2.3 and JRockit build R27.4.0-90_CR358515-94243-1.5.0_12-20080118-1154-windows-ia2
    Contents of C:\bea\jrockit_150_12\jre\license.bea:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <bea-licenses>
    <license-group format="1.0" product="JRockit" release="*">
    </license-group>
    </bea-licenses>
    Could WebLogic be misconfigured?
    Any diagnostics to help figure out the licensing?
    Any other ideas?

  • Memory Leak issue with TreeView

    Hi,
    I get Memory Leaks in the TreeView, if I open the stage which contains the TreeView several times.
    Everytime I open the stage, I clear the TreeView and populate it with new items.
    However there are leaks.
    I think this is a bug. But maybe my code is wrong and someone could comment on this issue.
    See this test case:
    i < 10: 5854 KB
    i < 100: 35944 KB
    i < 200: 64515 KB
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.TreeItem;
    import javafx.scene.control.TreeView;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    import javafx.stage.WindowEvent;
    public class TestApp3 extends Application {
        public static void main(String[] args) throws Exception {
            launch(args);
        public void start(final Stage stage) throws Exception {
            VBox root = new VBox();
            SubStage subStage = new SubStage();
            for (int i = 0; i < 10; i++) {
                subStage.show();
                subStage.hide();
            System.gc();
            System.out.println((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 + " KB");
            Scene scene = new Scene(root);
            stage.setScene(scene);
            stage.show();
        private class SubStage extends Stage {
            public SubStage() {
                TreeView<String> treeView = new TreeView<String>();
                final TreeItem<String> rootNode = new TreeItem<String>("Root");
                treeView.setRoot(rootNode);
                setOnShowing(new EventHandler<WindowEvent>() {
                    @Override
                    public void handle(WindowEvent windowEvent) {
                        rootNode.getChildren().clear();
                        rootNode.getChildren().add(new TreeItem<String>("Item"));
                Scene scene = new Scene(treeView);
                setScene(scene);
    }Edited by: csh on 07.09.2012 06:14
    Edited by: csh on 07.09.2012 06:14

    Hi. If You replace
        rootNode.getChildren().clear();
        rootNode.getChildren().add(new TreeItem<String>("Item"));
      with:
         rootNode.getChildren().setAll( new TreeItem<String>("Item"));
    You will get the following:
    i < 10: 2881 KB
    i < 100: 3341 KB
    I <200: 3478 KB

  • 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 problem while passing Object to stored procedure from C++ code

    Hi,
    I am facing memory leak problem while passing object to oracle stored procedure from C++ code.Here I am writing brief description of the code :
    1) created objects in oracle with the help of "create or replace type as objects"
    2) generated C++ classes corresponding to oracle objects with the help of OTT utility.
    3) Instantiating classes in C++ code and assigning values.
    4) calling oracle stored procedure and setting object in statement with the help of setObject function.
    5) deleted objects.
    this is all I am doing ,and getting memory leak , if you need the sample code then please write your e-mail id , so that I can attach files in reply.
    TIA
    Jagendra

    just to correct my previous reply , adding delete statement
    Hi,
    I am using oracle 10.2.0.1 and compiling the code with Sun Studio 11, following is the brief dicription of my code :
    1) create oracle object :
    create or replace type TEST_OBJECT as object
    ( field1 number(10),
    field2 number(10),
    field3 number(10) )
    2) create table :
    create table TEST_TABLE (
    f1 number(10),f2 number (10),f3 number (10))
    3) create procedure :
    CREATE OR REPLACE PROCEDURE testProc
    data IN test_object)
    IS
    BEGIN
    insert into TEST_TABLE( f1,f2,f3) values ( data.field1,data.field2,data.field3);
    commit;
    end;
    4) generate C++ classes along with map file for database object TEST_OBJECT by using Oracle OTT Utility
    5) C++ code :
    // include OTT generate files here and other required header files
    int main()
    int x = 0;
    int y = 0;
    int z =0;
    Environment *env = Environment::createEnvironment(Environment::DEFAULT);
    Connection* const pConn =
    env->createConnection"stmprf","stmprf","spwtrgt3nms");
    const string sqlStmt("BEGIN testProc(:1) END;");
    Statement * pStmt = pConn->createStatement(sqlStmt);
    while(1)
    TEST_OBJECT* pObj = new TEST_OBJECT();
    pObj->field1 = x++;
    pObj->field2 = y++;
    pObj->field3 = z++;
    pStmt->setObject(1,pObj);
    pStmt->executeUpdate();
    pConn->commit();
    delete pObj;
    }

  • Client-side Memory leak while executing PL/SQL and reading from a view

    Iam noticing memory leaks in OCCI while performing the following:
    Sample function()
    1. Obtain a connection
    2. Create a statement to execute a PL/SQL procedure
    3 Execute the statement created in step #2
    4. Terminate the statement created in step #2
    5. Create a statement to read from a view which was populated
    by executing stored procedure in step #3
    6. Execute the statement created in step #5
    7. Terminate the statement created in step #5
    8. Release the connection
    The PL/SQL populates a view with fixed 65,000 records for every execution. PL/SQL opens a cursor, loads 65000 records and populates the target view and closes the cursor at the end. If i invoke the above function it results in memory leak of 4M for every call. I tried several variants such as:
    1. Disabling statement caching
    2. Using setSQL instead of newly creating second SQL statement
    3. Obtaining two separate connections for these two activities (PL/SQL exec and View read)
    4. Breaking the sample function into two, one for each of these activities (PL/SQL exec and View read).
    All the combinations results in the same behaviour of 4M memory leak.
    Iam using Oracle 10g Client/Server 10.2.0.1.0.
    Is there any known limitations in this area?

    Yes. Iam closing the result set and terminating the statement.
    My program contains layers of inhouse wrapper classes, which will take some time for
    me to present it in pure OCCI calls, to be posted here for your understanding.
    After some more debugging, i found that if the connection level statement caching is set to
    0, the memory leak is much lower than before.
    Thanks.
    Message was edited by:
    user498920

  • Memory leak using pthreads on Solaris 7

    I'm on Solaris 7
    uname -a:
    SunOS zelda 5.7 Generic_106541-18 sun4u sparc SUNW,Ultra-250
    compiling with g++ (2.95.2)
    purify 5.2
    I consistently get memory leaks related (apparently)
    to the pthreads lib. I've set the error reporting chain length to 30 (way big), the start of the chain in every case starts with threadstart [ libthread.so.1 ]
    when I end my process, I Join the threads before deleting them. What else can I do to get rid of these leaks?
    thanks,
    rich

    is it worth upgrading to a 64 bit OS with more ram.
    Well you're talking a fairly hefty investment in fact your best bets buying a new machine at that point since the motherboard would need to be upgraded as well as memory and OS.
    Now  I run on a 64 bit OS 12 gigs of ram, but i love my plug-ins, and most are 32 bit, so you would still be using the 32 bit Photoshop if you want the majority of all plugins for photoshop to work. Well while the 32 bit version still have the memory limitations on how much memory it can use, Because its in the 64 bit OS, you have available the full amount of that limitation available to the application.
    I can run several different memory intensive applications at one time and normally not have an issue.  I say normally cause, sometimes i will crash my graphics driver if i open one too many 3d apps hooked into the Nvidia drivers.
    I normally only reboot maybe once a week.
    So in short, would it help you to be able to go 64 bit with more ram, Most Certainly even more so if you could care less about plug-ins and want to use the 64 bit version. should you go to 16 gigs of ram.. That depends on your budget really,
    Personally I always plan to upgrade when I build my systems, Putting in the largest chips you can with out filling all the slots leaving room for upgrading if needed. that way you're not filling all your slots with cheaper lower memory ram that you would have to replace them all to upgrade.
    Hope this helps a bit

  • OCIServerAttach possible memory leak

    Hi
    For the last day I'm stuck in this case...and I'm pretty sure it is a memory leak:
    I have a multithreaded application, in C++. First I create a threaded environment (OCIEnvCreate in OCI_THREADED mode) in the main application thread. Next i start multiple threads, and in each one I open a new session to the Oracle database, using OCIServerAttach and next OCIBeginSession.
    I'm testing the case when the threads keep failing and they are restarted. For the tests I use an invalid schema (a dummy name that's not present in tnsnames.ora) when calling OCIServerAttach. In this case the statement fails and I call OCIServerDetach, which it should release the memory allocated in OCIServerAttach, but it seems that it doesn't do that...I watched the application with a memory leak detection tool and i keep getting memory leaks in OCIServerAttach....
    I read about this exact problem in some older Oracle releases, 8i. Now I'm using Oracle 9.2 with 9.2.0.4 patch installed.
    Please help me with any idea, cause i'm getting desperate...
    marius

    exactly :) it doesn't seem like it has leaks :) but...
    i made a test where i restarted 4 threads about 2000 - 3000 times (each time executing OCIServerAttach - OCIServerDetach)...and i got about 400 leaks. it's not for each thread...i don't get it
    here is the code:
    - open a new session:
    bool CORCLSession::beginSession(IN OCIEnv* phEnv,
                                            IN const char* pszConnectString)
         if (true == m_fConnected)
              endSession();
         m_phEnv = phEnv;
         strcpy(m_szConnectString, pszConnectString);
         char szUserName[MAX_CONNECT_STRING];
         char szPassword[MAX_CONNECT_STRING];
         char szSchema[MAX_CONNECT_STRING];
         splitConnectString(m_szConnectString, szUserName, szPassword, szSchema);
         /* allocate an error handle */
         m_nRetCode = OCIHandleAlloc((dvoid *)m_phEnv,
                                            (dvoid **)&m_phError,
                                            OCI_HTYPE_ERROR, 0, (dvoid **) 0);
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         /* allocate a server handle */
         m_nRetCode = OCIHandleAlloc ((dvoid *)m_phEnv, (dvoid **)&m_phServer,
                             OCI_HTYPE_SERVER, 0, (dvoid **) 0);     
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         /* create a server context */
         m_nRetCode = OCIServerAttach (m_phServer, m_phError,
                                            (text *)szSchema, strlen(szSchema),
                                            OCI_DEFAULT);
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         m_fAttach = true;
         /* allocate a service handle */
         m_nRetCode = OCIHandleAlloc((dvoid *)m_phEnv,
                                            (dvoid **)&m_phSvcCtx,
                                            OCI_HTYPE_SVCCTX, 0, (dvoid **) 0);
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         /* set the server attribute in the service context handle*/
         m_nRetCode = OCIAttrSet((dvoid *)m_phSvcCtx, OCI_HTYPE_SVCCTX,
                                       (dvoid *)m_phServer,
                                       (ub4) 0, OCI_ATTR_SERVER, m_phError);
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         /* allocate a user session handle */
         m_nRetCode = OCIHandleAlloc((dvoid *)m_phEnv,
                                            (dvoid **)&m_phUserSession,
                                            OCI_HTYPE_SESSION, 0, (dvoid **) 0);
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         /* set username attribute in user session handle */
         m_nRetCode = OCIAttrSet((dvoid *)m_phUserSession, OCI_HTYPE_SESSION,
                                       (dvoid *)szUserName, (ub4)strlen(szUserName),
                                       OCI_ATTR_USERNAME, m_phError);
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         /* set password attribute in user session handle */
         m_nRetCode = OCIAttrSet((dvoid *)m_phUserSession, OCI_HTYPE_SESSION,
                                       (dvoid *)szPassword, (ub4)strlen(szPassword),
                                       OCI_ATTR_PASSWORD, m_phError);
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         /*begin session !*/
         m_nRetCode = OCISessionBegin(     m_phSvcCtx, m_phError, m_phUserSession,
                                                 OCI_CRED_RDBMS, OCI_DEFAULT);
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         /* set the user session attribute in the service context handle*/
         m_nRetCode = OCIAttrSet((dvoid *)m_phSvcCtx, OCI_HTYPE_SVCCTX,
                                       (dvoid *)m_phUserSession, (ub4) 0,
                                       OCI_ATTR_SESSION, m_phError);
         handleRetCode(CORCLException::OSES_BEGINSESSION);
         m_fConnected = true;
         return true;
    - closing a session:
    void CORCLSession::endSession()
         if (m_fAttach)
              // first detach the server
              m_nRetCode = OCIServerDetach(m_phServer, m_phError, OCI_DEFAULT);
              m_fAttach = false;
         if(m_fConnected)
              m_nRetCode = OCISessionEnd(     m_phSvcCtx, m_phError,
                                                 m_phUserSession, OCI_DEFAULT);
              m_fConnected = false;
         if (m_phServer != NULL)
              // now de-alloc the server handle
              m_nRetCode = OCIHandleFree((dvoid*)m_phServer, OCI_HTYPE_SERVER);
              m_phServer = NULL;
         if (m_phError != NULL)
              m_nRetCode = OCIHandleFree((dvoid*)m_phError, OCI_HTYPE_ERROR);
              m_phError = NULL;
         if (m_phUserSession != NULL)
              m_nRetCode = OCIHandleFree((dvoid*)m_phUserSession , OCI_HTYPE_SESSION);
              m_phUserSession = NULL;
         if (m_phSvcCtx != NULL)
              m_nRetCode = OCIHandleFree((dvoid*)m_phSvcCtx , OCI_HTYPE_SVCCTX);
              m_phSvcCtx = NULL;
    }

  • NewDirectByteBuffer memory leak

    I ve coded a new JNI program , when i try to use NewDirectByteBuffer function ,
    i get memory leak on my program , when i cancel NewDirectByteBuffer function call everything is going ok after that i ve added DeleteLocalRef function may stop memory leak but its not...Whats the problem can be ? Is it a bug ?
    I'm using Java 6 SDK AMD64bit edition
    static JNIEnv *pEnv = NULL;
    g_pVM->AttachCurrentThread( (VOID**)&pEnv,NULL );
    jobject objectByteBuffer = pEnv->NewDirectByteBuffer(pBuffer,lBufferSize);
    pEnv->CallVoidMethod(g_ObjListener,g_methodID,objectByteBuffer);
                   pEnv->DeleteLocalRef(objectByteBuffer);

    I want to build a library and pass that ByteBuffer to external users'If it was me I would try to get rid of that requirement. But otherwise....
    Finalize would be required but only as a fail safe. You should not document that you have such a fail safe. Rather you should document that the users must correctly call a cleanup method when they are through. And document it in such a way to make it obvious how it must work with exceptions as well.
    If this really is a library, where you are unlikely to be able to assist the users, then you might want to provide an optional way to track how many buffers have been allocated and cleaned. Thus the users will have a primitive way to validate correct clean up.

  • Memory leak while appending uchar16 * to PMString

    Hi,
    I am using code like
    const uchar16 * TempWString ="Value";
    PMString str("");
    str.AppendW(TempWString);
    this. here I am getting memory leak at the line str.AppendW(TempWString);
    Can anyone help me out.
    Thanks,
    Amit.

    It's JDK1.3.0 that I am using, didn't try to run it on 1.4

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

Maybe you are looking for

  • How can you change your security question for I tunes?

    How can you change your security question for I tunes?

  • Reason code SE is not defined

    I have created credit memo request in VA01. i have generate biling documnet (credit memo) VF01 but accounting document not generate. it is giving error message when i am trying to release manuvally. "Reason code SE is not defined" Message no. F5596.

  • [T500] DVD recording + warranty

    Hello. I have following problem - if I try to burn a DVD-DL with built-in DVD recorder after about 3-4 GiB it returns an unknown errors. Do I have to return whole notebook or is it possible to have only FRU part on warranty (DVD recording is not esse

  • Editing JAVA mapping Code

    Hi Experts, Need your help in editing the JAVA mapping code...I know it would be done by some external tool like Eclipse, netweaver studio..I just need to make a small change in the code and reimport the same in PI mapping. Can someone help me in pro

  • I can't find half of my purchased movies in itunes how can i retrieve them?

    i can't find half of my purchased movies in itunes how can i retrieve them?