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

Similar Messages

  • 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

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

  • Memory leak in image rings on Linux

    Hello all,
    I have a very serious problem I didn't have in previous version of my soft and one of the only addition I've made recently is to use image rings. The soft uses 6Mb more every minute. If I remove the rings, it stops. It could be a wrong lead, so I'm trying to write a test case, but is there a list of identified memory leaks somewhere ?
    THanks.
    Solved!
    Go to Solution.

    OK guys, there's a very serious leak on Linux, confirmed by the code below. Every time you change the value of a picture ring, either by clicking on the arrow of the picture ring or right-click on it (callback to SetCtrlVal), it uses 1 extra Mb of mem for a 512x512 pixel image !!!
    Here's a sample code:
    // Right-click the ring to cause memory leak
    #include <stdio.h>
    #include <stdlib.h>
    #include <cvirte.h>
    #include <userint.h>
    #define RND_COLOR (((rand()<<16) ^ (rand()<<8) ^ rand()) & 0xFFFFFF)
    // (int)((double)(0xFFFFFF)*rand()/RAND_MAX)
    static int Pnl=0,
    Text, Ring, // Controls
    NbVals=16, // Number of images in the ring
    Width=512, Height=512; // Of the Canvas and image ring
    // Returns memory used by process in 4Kb page:
    // TotalSize Resident Share Text Lib Data Dirty
    // See "man proc" section statm
    static char* ReadOffMemoryStatus(void) {
    static char statm[80];
    statm[0]='\0';
    #ifdef _NI_linux_
    FILE *f = fopen("/proc/self/statm","r");
    if (f)
    fgets (statm, 79, f),
    fclose(f);
    #endif
    return statm;
    static void Prepare(const int Nb) {
    Point polyPoints[10]={{0,0}};
    char Str[10];
    int i, Bitmap;
    int Canvas=NewCtrl(Pnl, CTRL_CANVAS, "", 0, 0);
    SetCtrlAttribute(Pnl, Canvas, ATTR_DRAW_POLICY, VAL_UPDATE_IMMEDIATELY);
    SetCtrlAttribute(Pnl, Canvas, ATTR_WIDTH, Width);
    SetCtrlAttribute(Pnl, Canvas, ATTR_HEIGHT, Height);
    // SetCtrlAttribute(Pnl, Canvas, ATTR_ENABLE_ANTI_ALIASING, 1); // No compile on Linux
    SetCtrlAttribute(Pnl, Canvas, ATTR_PICT_BGCOLOR, RND_COLOR /*VAL_TRANSPARENT*/);
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_FILL_COLOR, RND_COLOR);
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_COLOR, RND_COLOR);
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_WIDTH, 7);
    for (i=0; i<10; i++)
    polyPoints[i].x=(Width*rand()/RAND_MAX),
    polyPoints[i].y=(Height*rand()/RAND_MAX);
    sprintf(Str, "%d", Nb);
    // CanvasStartBatchDraw(Pnl, Canvas);
    // This sometimes doesn't work on Linux
    CanvasDrawPoly (Pnl, Canvas, 10, polyPoints, 1, VAL_DRAW_FRAME_AND_INTERIOR);
    CanvasDrawLine (Pnl, Canvas, MakePoint(Width-1,0), MakePoint(0, Height-1));
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_COLOR, VAL_BLACK);
    SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_FILL_COLOR, VAL_WHITE);
    CanvasDrawText(Pnl, Canvas, Str, VAL_APP_META_FONT,
    MakeRect (2, 2, VAL_KEEP_SAME_SIZE, VAL_KEEP_SAME_SIZE), VAL_UPPER_LEFT);
    // CanvasEndBatchDraw(Pnl, Canvas);
    GetCtrlBitmap(Pnl, Canvas, 0, &Bitmap);
    DiscardCtrl (Pnl, Canvas);
    InsertListItem(Pnl, Ring, Nb, NULL, Nb); // The value is the color, so remember which one you use
    SetCtrlBitmap (Pnl, Ring, Nb, Bitmap);
    DiscardBitmap (Bitmap);
    int CVICALLBACK cb_Change(int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2) {
    static int i=0;
    switch (event) {
    case EVENT_RIGHT_CLICK:
    case EVENT_RIGHT_DOUBLE_CLICK:
    SetCtrlVal(Pnl, Ring, i=(i+1)%NbVals);
    // No break;
    case EVENT_COMMIT:
    SetCtrlVal(Pnl, Text, ReadOffMemoryStatus());
    break;
    return 0;
    int CVICALLBACK cb_Quit(int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2) {
    switch (event) {
    case EVENT_COMMIT: QuitUserInterface (0); break;
    return 0;
    int main (int argc, char *argv[]) {
    int i, Quit;
    if (InitCVIRTE (0, argv, 0) == 0) return -1;
    Pnl = NewPanel (0, "Test image ring", 20, 20, Height+20, Width);
    Text = NewCtrl (Pnl, CTRL_STRING_LS, "Memory use (in 4Kb pages)", 0, 0);
    Ring = NewCtrl (Pnl, CTRL_PICTURE_RING, "", 20, 0);
    Quit = NewCtrl (Pnl, CTRL_SQUARE_BUTTON_LS, "", 50, 50);
    SetCtrlAttribute(Pnl, Ring, ATTR_HEIGHT, Height);
    SetCtrlAttribute(Pnl, Ring, ATTR_WIDTH, Width);
    SetCtrlAttribute (Pnl, Ring, ATTR_CTRL_MODE, VAL_HOT);
    SetCtrlAttribute(Pnl, Ring, ATTR_CALLBACK_FUNCTION_POINTER, cb_Change);
    for (i=0; i<NbVals; i++) Prepare(i);
    SetCtrlAttribute(Pnl, Text, ATTR_WIDTH, 250);
    SetCtrlAttribute(Pnl, Text, ATTR_LABEL_LEFT, 250);
    SetCtrlAttribute(Pnl, Text, ATTR_LABEL_TOP, 0);
    SetCtrlAttribute(Pnl, Quit, ATTR_CALLBACK_FUNCTION_POINTER, cb_Quit);
    SetCtrlAttribute(Pnl, Quit, ATTR_VISIBLE, 0);
    SetCtrlAttribute(Pnl, Quit, ATTR_SHORTCUT_KEY, VAL_ESC_VKEY);
    SetPanelAttribute(Pnl, ATTR_CLOSE_CTRL, Quit);
    DisplayPanel (Pnl);
    RunUserInterface ();
    return 0;
    There are other issues as well:
     - CanvasDrawPoly sometimes doesn't work.
     - The anti-aliasing on a canvas doesn't compile.
    Is there anything more recent than CVI 2010 for Linux ?!?

  • OBIEE 11.1.1.5 Memory Leak issues

    Hardware: 64 bit Red Hat Linux Enterprise server 5.2(Tikanga)
    Software: OBIEE 11.1.1.5 64 bit
    Issue: The memory usage on the server slowly creeps up and occupies almost all of the available memory, then starts swapping.
    In our case we have a 48GB RAM 2CPU Linux box on which OBIEE 11.1.1.5 was installed and once we startup Weblogic Server, NodeManager, Managed Server, and OPMN, the memory usage starts at ~4GB and slowly creeps up to ~45GB. The processes do not release the memory back even after shutting down all the services (OPMN, Managed Server, Weblogic Server and Node Manager).
    The memory is released only after the Linux box is rebooted.
    We have the same software on different boxes which have 8GB RAM and the behavior is same there too. It occupies all of 8GB RAM and then swaps over another 4GB space. Is there a software leak with OBIEE 11.1.1.5 or is it a configuration issue?
    We found similar issues reported in forums at Memory Leak on OBIEE webserver 11G (linux version) But there was no resolution.

    All,
    We're having a similar issue, or at least we think we are on our 64-bit VM Windows environment, running OBIEE 11.1.1.3. Our PROD environment was OS level patched last Tuesday and rebooted, and now it's super slow and using way more RAM than before. Even if we reboot the server, our Managed server (bi_server1) is not working properly. Basically in DEV the Admin and Managed servers are using around 900 MB or RAM, in our PROD env that isn't working properly, the Admin server seems fine at about 900 MB of RAM, but our Managed server is up around 1.4 GB and now taking about 45 minutes to start instead of around 6. We also logged an SR about a week ago to no avail so far, and as you said, it's been going back and forth with the OBIEE and WebLogic teams. If anyone knows anything about this it would be great to hear it!
    Thanks,
    Josh
    Edited by: JFuter on Aug 24, 2011 1:39 PM

  • 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 in ldap_parse_ds_event

    Hi,
    I'm doing some development with the eDir LDAP event API and noticed some
    memory leakage. Valgrind points the finger at ldap_parse_ds_event:
    ==32146== 220 bytes in 5 blocks are definitely lost in loss record 4 of 5
    ==32146== at 0x401CCA0: calloc (vg_replace_malloc.c:279)
    ==32146== by 0x404D995: ber_memcalloc (memory.c:293)
    ==32146== by 0x404CEEB: ber_alloc_t (io.c:271)
    ==32146== by 0x404CF84: ber_dup (io.c:307)
    ==32146== by 0x40520DB: ldap_parse_intermediate (extended.c:374)
    ==32146== by 0x4174176: ldap_parse_ds_event
    (/home/n4u_cm/ccm_wa/idc_n4u/cldap~sdk_2007June/cldap/nldapx/extensions/client/src/events.c:2325)
    ==32146== by 0x804AD94: main (idmtrace.c:839)
    Is anybody from Novell labs about that can fix this? 44 bytes per message
    received may not sound like a lot, but the code is dealing with trace
    messages so it gets large rather quickly. The problem exists in the latest
    June 2007 libraries, as well as the LDAP libraries released in eDir 8.7.3.9
    and 8.8.1.
    Thanks,
    Steve

    Hi Steve,
    It would be very nice if you can supply me with sample code to reproduce
    memory leak. I've no Linux box now but i'll try to reproduce the same
    problem on NetWare platform. Also i need brief description of eDir event
    to be monitored.
    Best Regards,
    Andrey Karyagin
    ABG Card Technology
    Software Development Department
    [email protected] wrote:
    > Hi,
    > I'm doing some development with the eDir LDAP event API and noticed some
    > memory leakage. Valgrind points the finger at ldap_parse_ds_event:
    >
    > ==32146== 220 bytes in 5 blocks are definitely lost in loss record 4 of 5
    > ==32146== at 0x401CCA0: calloc (vg_replace_malloc.c:279)
    > ==32146== by 0x404D995: ber_memcalloc (memory.c:293)
    > ==32146== by 0x404CEEB: ber_alloc_t (io.c:271)
    > ==32146== by 0x404CF84: ber_dup (io.c:307)
    > ==32146== by 0x40520DB: ldap_parse_intermediate (extended.c:374)
    > ==32146== by 0x4174176: ldap_parse_ds_event
    > (/home/n4u_cm/ccm_wa/idc_n4u/cldap~sdk_2007June/cldap/nldapx/extensions/client/src/events.c:2325)
    > ==32146== by 0x804AD94: main (idmtrace.c:839)
    >
    > Is anybody from Novell labs about that can fix this? 44 bytes per message
    > received may not sound like a lot, but the code is dealing with trace
    > messages so it gets large rather quickly. The problem exists in the latest
    > June 2007 libraries, as well as the LDAP libraries released in eDir 8.7.3.9
    > and 8.8.1.
    >
    > Thanks,
    > Steve

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

  • Oracle 8.1.5 Linux Memory Leak?

    We have been running Oracle 8.1.5 Server and Client on Redhat 6.1
    kernel 2.2.12-20
    glibc-2.1.2-11
    Blackdown's JDK 1.2 RC3
    We are having bad memory leaks and we have verified that they are
    not in our source code using a memory profiler for Java-linux.
    We are using the JDBC calls and the OCI JDBC driver.
    We think that the memory leak is in libocijdbc8.so but we're not
    sure. It could also be in glibc but the 2.1.2-11 version should
    be pretty stable. It could also be in the Blackdown jvm.
    Anyone have any ideas?
    null

    Oracle8iR2's JDBC works fine with Oracle8.1.5.
    You can download the new JDBC driver.
    null

  • Memory Leak in Linux

    Hi friends,
    Is anyone worked on any of the tools to identify and optimise Java Memory Leak in Linux environment?

    Hi friends,
    Is anyone worked on any of the tools to identify and
    optimise Java Memory Leak in Linux environment?Hi,
    I've been using Optimizeit on linux, and I like it.
    /Kaj

  • Memory leak using 10.2.0.3 OCCI client on Solaris 10

    Hi,
    We are using OCCI client libraries to connect our C++ program to the Oracle Database. The program does a lot of selects, inserts and SP calls.
    Oracle client and Oracle server both are 10.2.0.3 on Solaris 10.
    We have been observing a memory leak of 4M bytes in the C++ program every few minutes since last few days. On debugging through Purify, libumem, and Sun Studio 12, we finally managed to narrow down the problem to the Oracle client library OCI calls.
    The Sun Studio leak check shows the following -
    Leak #37, Instances = 157, Bytes Leaked = 655004
    kpummapg + 0x00000098
    kghgex + 0x00000648
    kghfnd + 0x000005BC
    kghalo + 0x00000A6C
    kghgex + 0x000003BC
    kghfnd + 0x000005BC
    kghalo + 0x00000A6C
    kghgex + 0x000003BC
    kghfnd + 0x000005BC
    kghalo + 0x00000A6C
    kpuhhalo + 0x00000558
    kpugdesc + 0x00000AD4
    kpugparm + 0x00000374
    COCIResultSet::InterpretData() + 0x000001B4
    COCIResultSet::COCIResultSet(COCIStatement*,OCIStmt*,OCIError*) + 0x000000A4
    COCIStatement::PrepareResult() + 0x00000190
    A select is executed, a resultset is fetched and the resultset is immeidately closed. The same piece of code has been running at various production systems without any problems. Most of the other sites are either 10.2.0.4 or 9i.
    On searching Metalink and various other forums, I found similar issues faced in 10.2.0.1.
    Could someone advise if there are any bugs corresponding to this which have been closed. Would upgrading to 10.2.0.4 solve the problem?
    Thanks.

    Please ... one post and one post only in the group most appropriate to your inquiry. Please open an SR at metalink.

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

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

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

  • Memory Leak while using -Xrunhprof option in Linux OS

    While using the follwing option in my application there is memory leak in JVM in Linux OS.
    -Xrunhprof:heap=all,cpu=times,monitor=y,file=/home/gemini/dilip/www2.log,thread=yIs this a bug ??

    Little lost here. Looks like you are facing memory leaks in Tuxedo 7.1 WS
    client code when it talks with Tuxedo 6.x? Is this correct?
    If so, try installing latest rolling patch for Tuxedo 7.1.
    We recently fixed couple of memory leaks in interop area. One was related to
    compression.
    _shailesh
    Scott Orshan <[email protected]> wrote in message
    news:[email protected]..
    If you are running with the latest patch, then report these problems to
    Support, giving them sample code so that they can reproduce the problem.
    Scott
    Thomas Winter wrote:
    Hi Scott,
    as an additional information:
    The guys at the server side changed something (their
    formaly useing the old 6.3 libraries at server side)
    and surprise... the client has no memory leak anymore.
    But, if more than one thread at the same time use the atmi calls
    there is still some memory consumption.
    The workaround is to use a mutex object to make sure, that
    only one thread use the atmi calls.
    AFAIS Tuxedo has an Problem with Multithreading.
    Thx
    Thomas

  • Detect memory leak in JNI so files for linux and Solaris

    I have to find the memory leaks in the JNI for solaris and linux but the issue is
    i need to find the leaks in the so files.I have solved the issues of leaks using Purify
    on windows but not getting appropriate support for linux. Any pointers to tools will help.I tried Valgrind on linux but it is not giving me the exact location of leak as in purify and also the support for purify is for 32 bit only.Valgrind is not showing any functions in .so files.JNI is not supported in Purify for Solaris? Please Help.

    amol28 wrote:
    I have to find the memory leaks in the JNI for solaris and linux but the issue is
    i need to find the leaks in the so files.I have solved the issues of leaks using Purify
    on windows but not getting appropriate support for linux. Any pointers to tools will help.I tried Valgrind on linux but it is not giving me the exact location of leak as in purify and also the support for purify is for 32 bit only.Valgrind is not showing any functions in .so files.JNI is not supported in Purify for Solaris? Please Help.If you have written the JNI, the JNI itself (java calls, methods, etc) to be OS agnostic then it shouldn't matter. In that case you check the windows code (not jni), the linux code (not jni) and the jni code itself independent of each other.
    If you haven't made the JNI OS agnostic the question would be why not?

Maybe you are looking for

  • I can not get LabVIEW to respond to a VB6 ActiveX event

    I am working with a VB6 ActiveX dll (VBtablet.dll is a wrapper for Wintab32 for a tablet interface) using LV8.2.1 and can not get it to respond to an event.  I have opend the object and registered it for callback, but have had no luck in having an ev

  • LCD Monitor Calibration Needed

    I just purchased a 3rd party 19" LCD monitor, and noticed the the thing is freaking bright! I need to calibrate this thing before it melts my eyes. I'm looking for either a tutorial on how to properly do this, or a program that will help me with this

  • Server Agent Job Failed

    Hello , I have created SSIS package to connect SAP using ado.net Connection  and i am successfully pooling data from sap to Sql server (2014 64 bit ) (Windows  server 2008 R2 (64 bit)). My Package is running properly using SSIS But when i try to sche

  • Sql*plus, instant client problems

    I want to connect a linux machine x86 to a server with oracle 9i. So first I wanted to install instant client and I did as is said in the page for basic, sql*plus and SDK packages, but it doesn't work. When I executed ./sqlplus user/pass@connectionch

  • SCCM 2012 R2 Update not Downloading

    Hi i had install SCCM 2012 R2 and WSUS  on the same server  and i configure the software update point component .(End Point Protection) when I'm trying  to download software  update, i  click  on All software updates  repository right click and  run