Memory leak in OCI Direct Path sample program in threaded mode

I have a slightly (okay, more than slightly) modified version of the sample program cdemodp.c, which uses OCI to do a Direct Path load. Since my eventual aim is to make a C++ module that loads a table from a file as part of a multithreaded program, I made the necessary changes so that cdemodp.c would compile with g++ (v3.3.1, on Solaris 2.8), and I put in the following in place of the OCIInitialize() and OCIEnvCreate() calls (since the docs say those are deprecated):
OCI_CHECK(0, 0, ociret, ctlp, OCIEnvCreate(&ctlp->envhp_ctl, OCI_THREADED, (void *) 0, 0, 0, 0, (size_t) 0, (void **) 0));
When I compile and run this version of the program using Purify, I get a 60-byte memory leak inside the OCI code (meaning I can't see the source-code line that is causing the leak). I am pretty sure it's not anything in my code (i.e., me failing to free all handles or something) because when I change the above line so that the mode parameter is OCI_DEFAULT and recompile, there is no memory leak. Since this will be part of a threaded application that is always running, it is critical to make sure there are no leaks.
Purify says that the leaked memory was allocated from:
malloc [rtlib.o]
calloc [rtlib.o]
nlepeinit [nlepe.c]
nlstdggo [nlstdgo.c]
nlstdgg [nlstdgo.c]
nigini1 [nigini.c]
I am using Oracle 10g (client version 10.1.0).
Anyone else had this happen?
Thanks,
--Tina Mancuso                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

This sounds very similar to the memory leak I have in Oracle 9i using Pro*C++. Everytime a connect is made memory appears to leak and it only happens in multithreaded mode not default mode. There is a thread about this under the Oracle C++ call interface. Under 9i it appears to leak about 60K per connect rather than 60 bytes.
Paul

Similar Messages

  • OCI direct path loading

    Hi all,
    I wrote sample program for test OCI direct path mechanism.
    I created partitioned table with 90 columns and 5 local indexes.
    Program's blocks are:
    1.init - allocate and initialize DP context + prepare
    2.load data
    2.1 fill data - OCIDirPathStreamReset + OCIDirPathColArrayReset + OCIDirPathColArrayEntrySet + OCIDirPathColArrayToStream + OCIDirPathLoadStream
    2.2 OCIDirPathDataSave(OCI_DIRPATH_DATASAVE_SAVEONLY)
    3.finish - OCIDirPathFinish - committ and free server structures
    Point 2.1 prepares records package (i.e. 20000) and point 2.2 executes save point. Load data procedure (point 2) can be executed in loop.
    All works fine but...
    It is possible to execute committ in point 2.2 without re-initialization?
    I try SQL Loader and it loads 10000 rec/sec - my program 3900 rec/sec. Why there is so big divergence.
    Can I control/set moment when indexes are rebuilded (i.e. after committ , save point or never).
    Why OCIDirPathPrepare takes too much time ~40[sec] when table has indexes and ~2[sec] when they are dropped?
    I use Oracle10g if someone has experience with OCI dp ... thanks for help.

    Found the problem. When I set the number of columns, I was using a ULong32 which corresponds to a ub4 type, however, this should be passed as a ub2 type instead.

  • OCI Direct Path Using Shared Connections?

    Hello there. A co-worker and I are working on developing a system using direct path. I designed it to follow the very basic direct path approach, and he suggested I try and share the database connection. I then wrote a class for sharing the connection, and everything seems to work fine until the OCIDirPathFinishLoad() is called. I get a 00600 code, which basically means some internal error code, and that I should contact Oracle about it. My question is whether I should be able to do two direct path loads using a single connection, or do I need to use multiple connections/multithread?
    I'd appreciate responses to [email protected] Thank you!

    Hi
    Need ur help.
    I am using OCI Direct path loads. It is working fine.
    But when I try to do the parallel mode, it is not working.
    For parallel mode, the only extra things that happens is:-
    if (tblp->parallel_tbl) /* set table level parallel option */
    OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp,
    OCIAttrSet((dvoid *)dpctx, (ub4)OCI_HTYPE_DIRPATH_CTX,
    (dvoid *)&tblp->parallel_tbl,
    (ub4)0, (ub4)OCI_ATTR_DIRPATH_PARALLEL,
    ctlp->errhp_ctl));
    But when I do this, the following calls returns a zero value for "ctlp->nrow_ctl" (it returns a value > 0 when I dont do the parallel thing above)
    /* get number of rows in the column array just allocated */
    OCI_CHECK(ctlp->errhp_ctl, OCI_HTYPE_ERROR, ociret, ctlp,
    OCIAttrGet((CONST dvoid *)(ctlp->dpca_ctl),
    OCI_HTYPE_DIRPATH_COLUMN_ARRAY,
    (dvoid *)(&ctlp->nrow_ctl), (ub4 *)0,
    OCI_ATTR_NUM_ROWS, ctlp->errhp_ctl));
    I'm using the sample code given by oracle, with minimal changes.
    Thanks in advance

  • COM+ and OLEDB - memory leak in OCI dlls

    Hi forum,
    I've a COM+ DLL written in C++ which uses OLEDB(Oracle 8.1.7 provider) to reach to the 8i database. I've observed that after some 1000 database activities the DLLhost.exe hogs on memory to the tune of 50MB and never releases the same. I also saw the same behavior with a Win32 console application. For some reason the Uninitialize of the IDBIntialize does not seem to reduce the memory. I also ran bounce checker on my code. And its pointing to the OCI dlls for a memory leak of 18K per each database activity.
    I downloaded the OLEDB sample code(VCOLEMRecordsSample) from the OTN site:-
    http://otn.oracle.com/sample_code/tech/windows/ole_db/oledb8/index.html
    This also seems to hold on to memory after successive run of SQL queries.
    Is there anything that I am missing. I am curious about the fact that it happens with the sample app hosted on the OTN site. Do I need some OCI patches to be applied to the client? In fact, applied couple of them, but does not help.
    Appreciate any pointers!

    I am using 8.1.7.3.2. In fact I applied this patch recently.
    Also today I detected a memory leak in my code.
    After GetColumnsInfo() call I was not releasing the last param(ppStringsBuffer).
    This seems to have fixed the problem. I tried running the win32 console app for 5,000 runs(each run has 2 SQL queries and 1 stored proc). The peak mem usage stays stable around 26MB and the mem usage varies from 8MB to 26MB. I guess this is fine, any info?

  • Memory leak in OCI while using AQ

    There seems to be a serious memory leak in the OCI driver (9.2.0.1) when using a JAVA client to dequeue a database queue (Advanced Queuing).
    Continuous dequeuing causes the heap memory to increase, and this memory never gets freed which leads me to suspect a memory leak in the OCI components (as the memory allocated for the JVM is constant). The heap memory increases by 3-4 MB after a dequeue of 1000 RAW messages,
    Has anyone come across this problem before and if so are there any solutions? Changing to a thin driver is not a solution for me due to other requirements.
    I'm using using Oracle client v9.2.0.1 libraries running on Solaris 8.
    The source code for my JAVA test client is as below:
    /* JAVA dequeue */
    package com.ubsw.risk.pce.eventqueues.test;
    import oracle.AQ.*;
    import java.sql.*;
    import oracle.jdbc.*;
    public class testRawDequeue {
    public testRawDequeue() {
    public static void main(String[] args) {
    Connection conn = null;
    AQSession aq_sess = null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    //Use OCI connection
    conn = DriverManager.getConnection("jdbc:oracle:oci:@DB_NAME.world","user","password");
    conn.setAutoCommit(false);
    Class.forName("oracle.AQ.AQOracleDriver");
    while(true) {
    aq_sess = AQDriverManager.createAQSession(conn);
    runTest(aq_sess);
    aq_sess.close();
    aq_sess = null;
    System.gc();
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println(e.toString());
    try {
    if (aq_sess != null) {
    aq_sess.close();
    if (conn != null) {
    conn.close();
    } catch (SQLException sqle) {
    public static void runTest(AQSession aq_sess) throws AQException, SQLException
    AQQueueTable q_table;
    AQQueue queue;
    AQMessage message;
    AQRawPayload raw_payload;
    AQEnqueueOption enq_option;
    String test_data = "new message";
    AQDequeueOption deq_option;
    byte[] b_array;
    /* Get a handle to a queue - in aquser schema: */
    queue = aq_sess.getQueue ("user", "raw_msg_queue");
    System.out.println("Successful getQueue");
    /* Creating a AQDequeueOption object with default options: */
    deq_option = new AQDequeueOption();
    /* Dequeue a message: */
    message = queue.dequeue(deq_option);
    System.out.println("Successful dequeue");
    /* Retrieve raw data from the message: */
    raw_payload = message.getRawPayload();
    b_array = raw_payload.getBytes();
    System.out.println("bytes:" + b_array.toString());
    queue.close();
    ((AQOracleSession)aq_sess).getDBConnection().commit();

    This sounds very similar to the memory leak I have in Oracle 9i using Pro*C++. Everytime a connect is made memory appears to leak and it only happens in multithreaded mode not default mode. There is a thread about this under the Oracle C++ call interface. Under 9i it appears to leak about 60K per connect rather than 60 bytes.
    Paul

  • Will the memory leak for queue when used in producer and consumer mode in DAQ to transfer different sized array.

    In the data acquisition, I use one loop to poll data from hardware, another loop to receive the data from polling loop sent by queue.
    But everytime the size of the transferred data array may not be the same, so the system may assign different array size and recycle very frequently.
    Will it cost memory leak. Or will it slow down the performance, since the array size is not fixed, so every time need to create a new sized array.
    Any suggestion or better method. 
    Solved!
    Go to Solution.

    As i understand your description, your DAQ-loop acquires data with the setting '-1' for samples to read at the DAQmx read function. This results in the different array sizes.
    Passing those arrays directly to a queue is valid and it does not have significant drawback in performance (at least as far as i know) and it definetly does not leak memory.
    So the question is more or less:
    Is it valid that your consumer receives different array sizes for analysis? How does your consumer handle those arrays? 
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Direct Path Loading Issues with Global Temporary Tables - OCI & OCILib

    I am writing some code to import data into a warehouse from a CPU grid which computes risk data. Due to the fact a computing grid is used there will be many clients which can load the data concurrently and at any point in time.
    Currently the import uses Binding in OCCI and chunking with a prepared statement to import the data into a global temporary table in a staging area after which a stored procedure is called within the same session which will process the data and load the data into a star schema.
    The GTT has the advantage that if any clients have issues no dirty data will be left and each client only sees their own instance of the data.
    I have been looking at using direct path loading to increase the performance of the load and have written some OCI code to perform the same task. I have manged to import the data into a regular heap based table using the OCI direct path apis. However when I try and use the same code to import against a Global Temporary Table I get an OCI Error (ORA-00600: internal error code, arguments: [6979], [16], [1], [1318528], [], [], [], [], [], [], [], [])
    I get error when the function OCIDirPathPrepare is executed. The same issue occurs in both OCI and OCILib.
    Is it not possible to use Direct Path Loading against a Global Temporry Table ? Because you can use the /*+ APPEND */ hint and load global temporary tables this way from tools like SQL Devloper / toad which is surely informing the SQL Engine to use Direct Path ?
    Looking at the table USER_OBJECTS I can see that for a Global Temporary Table the DATA_OBJECT_ID is null. Does this mean that it is impossible to us a direct path load into Global Temporary Tables ?
    Any ideas / suggestions would be really appreciated. If this means redesigning the application then I would appreciate suggestions which would allow many client to quick write processes in a parallel fashion. If this means creating a new parition in a Heap Table for each writer and direct path loading into this table then so be it.
    Thanks
    H
    Edited by: 813640 on 19-Nov-2010 11:08

    Replying to my own message in case anyone else is interested.
    I have now managed to successfully load data using direct path into a global temporary table with OCI. There appears to be no reason why this approach will not work.
    I loaded data into the temporary table and then issued a select count(*) on the table from within the session and from a new session. The results were as expected.
    The resaon for the ORA-006000 error was due to the fact that I had enabled table level parallel loading
    ie
    OCIAttrSet((dvoid *) context, (ub4) OCI_HTYPE_DIRPATH_CTX, *(ub1) 1*, (ub4)0, (ub4) OCI_ATTR_DIRPATH_PARALLEL, errhp)
    When loading a Global Temporary Table the OCI_ATTR_DIRPATH_PARALLEL attribute needs to be zero
    This makes sense, since the temp table does not have any partitions so it would not be possible to write in parallel to multiple paritions.
    Edited by: 813640 on 22-Nov-2010 08:42

  • RMI memory leak

    My program use RMI, and I remark memory leak, then I tried RMI sample from jbuilder6, I modified this sample, to send 1Mb file via RMI.
    I write how much RAM are used
    before 168 mb
    rmiregistry 172Mb used 8 Mb
    RMIserver 189Mb 18 Mb
    RMIclient up to 227Mb 38Mb
    end when RMIclient exit 212Mb where is 23 Mb??? 212-189 ????
    This is my changes, and all program are after that:
    public String getDate() {
    System.out.println("SimpleRMIImpl.getDate()");
    String s=null;
    try {
    InputStream fileIn = new FileInputStream("Readme.txt2");
    byte buff[] = new byte[fileIn.available()];
    int i = fileIn.read(buff);
    s = new String(buff);
    } catch(FileNotFoundException e) {
    e.printStackTrace();
    } catch(IOException e) {
    e.printStackTrace();
    return new String(s);
    All program:
    package com.borland.samples.rmi;
    import java.rmi.*;
    import java.rmi.registry.*;
    import java.rmi.server.*;
    import java.util.Date;
    public class SimpleRMIClient
    public static void main(String[] argv) {
    String serverName = "";
    System.setSecurityManager(new RMISecurityManager());
    if (argv.length != 1) {
    try {
    serverName = java.net.InetAddress.getLocalHost().getHostName();
    catch(Exception e) {
    e.printStackTrace();
    else {
    serverName = argv[0];
    if (serverName == "") {
    System.out.println("usage: java SimpleRMIClient <IP address of host running RMI server>");
    System.exit(0);
    try {
    //bind server object to object in client
    SimpleRMIInterface myServerObject = (SimpleRMIInterface) Naming.lookup("//"+serverName+"/SimpleRMIImpl instance");
    //invoke method on server object
    String d = myServerObject.getDate();
    System.out.println("Date on server is " + d);
    catch(Exception e) {
    System.out.println("Exception occured: " + e);
    System.exit(0);
    System.out.println("RMI connection successful");
    package com.borland.samples.rmi;
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.FileInputStream;
    public class SimpleRMIImpl extends UnicastRemoteObject implements SimpleRMIInterface
    public SimpleRMIImpl(String name) throws RemoteException {
    super();
    try {
    Naming.rebind(name, this);
    catch (Exception e) {
    if (e instanceof RemoteException)
    throw (RemoteException)e;
    else
    throw new RemoteException(e.getMessage());
    public String getDate() {
    System.out.println("SimpleRMIImpl.getDate()");
    String s=null;
    try {
    InputStream fileIn = new FileInputStream("Readme.txt2");
    byte buff[] = new byte[fileIn.available()];
    int i = fileIn.read(buff);
    s = new String(buff);
    } catch(FileNotFoundException e) {
    e.printStackTrace();
    } catch(IOException e) {
    e.printStackTrace();
    return new String(s);
    package com.borland.samples.rmi;
    public interface SimpleRMIInterface extends java.rmi.Remote
    public String getDate() throws java.rmi.RemoteException;
    package com.borland.samples.rmi;
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class SimpleRMIServer
    public static void main(String[] argv) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    SimpleRMIImpl implementation = new SimpleRMIImpl("SimpleRMIImpl instance");
    System.out.println("SimpleRMIImpl ready");
    catch (Exception e) {
    System.out.println("Exception occurred: " + e);
    Can you explain why this program use so much memory?
    Valdas

    Memory Usage and its distribution are done by the JVM....u cannot posibly account for each Mega bit of memory while it is used. Also, the File Copying Operation Involves JVM interacting with the OS which in turn interacts with the peripeherals such as ur harddisk, which are comparetively slower then the Processor speed. So the bottom line is ur same program will work at different RAM levels in diff machines with diff hardwares......If u system is indeed working too much then u can check out and sut down many services that u might have otherwise started...posiiblity of a Virus should not be ruled out either.....and the code itself is no problem at all although u might increase a bit by using some FIleReader, BufferredReader/Writer and other faster Streams.
    Hope it helps,
    Cheers,
    Manja

  • 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;
    }

  • Memory Leak with JPopupMenu

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

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

  • Memory Leak 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

  • How can memory leaks occur?

    Hi,
    I was just wondering how a memory leak can occur in Java. The garbage collector is supposed to free up all unused variables, so under what circumstances can it happen?

    This is not technically a "memory leak". I've seen
    this called "loitering objects", which conjures upa
    vivid picture: objects hanging around with nothingto
    do...I think it's the classic java memory leak. A bug in
    a program that prevents the freeing up of memory that
    it no longer needs.Yes, but it's not what is traditionally termed a memory leak.
    A real memory leak is memory that's claimed by the program but no longer accessible to the program for freeing up.
    That can in Java (where what we call a program isn't a complete program but runs inside a virtual machine which handles memory allocation and deallocation) only happen if there's a flaw in the JVM itself which causes errors in memory deallocation (so most likely a flaw in the garbage collector).
    In Java the objects you create are always out there somewhere where something can reach them so as to prevent them from being available to the garbage collector.
    Different cause, same effect in that in both cases memory isn't getting freed for reuse.

  • Memory leak in IMAQ Write PNG File

    Hi,
    I have a labview program that I'm using to do Speckle Patter Interferometry - it takes an image, takes a second image after some time, then subtracts the original image from the first and saves the subtraction.  The process reveals fringes on an object deformed on wavelength scales.
    The problem currently is that the program seems to have a memory leak.  When I run the program, the amount of memory being used (according to Windows Task Manager) just keeps going up and up then after about 20 minutes, it crashes with the error:
    Error 1074396159
    Not enough memory for required operation
    The error is normally when the file tries to write the png file - though that is the part of the program that takes the most time so it could just be coincidence that it happens at this point in the loop.
    I've tried using the labview profiler (output attached), but can't see a particular VI that is using an abhorrent amount of memory.
    I'm fairly stuck for ideas - I've attached a library with the VI and its sub VIs - if anyone would be so kind as to give me a hand I'd be very much appreciative.  I realise that my code is quiet messy - this is my first attempt at labview (albeit quite a long way into my first attempt) so any suggestions would be much appreciated also.
    Thanks
    Sam
    Attachments:
    ESPI.llb ‏556 KB
    memory_profile.txt ‏237 KB

    Hi Sam, 
    I'm glad to hear that you managed to fix the problem in your code. I have had a look at the code you posted and I have a few suggestions on how you can improve it.
    In your code you haven't included the error clusters from the VIs. Most sub VI functions included in LabVIEW will have an Error In and Error Out port that will transfer any error information through the VI. If an error does occur in the code, the error will be passed through the rest of the VI. If a sub VI or function receives an error at its error in port the VI will not execute and the error will pass through until it reaches the end of the VI. At the end of a the VI there needs to be an Error Handler function to display the error information. As error information flows through the VI the same as the data, using error clusters is a good way to determine the flow of data through a VI. This is a good way to determine the data flow through the VI as opposed to Sequence Structures which should be used in moderation.  
    I have taken a segment of you code and made some minor modifications to demonstrate how error clusters can be used (see screenshot below).  
    Error clusters can be implemented into any logic for the stop condition of a while loop. The Unbundle by Name using the Status option can be used in conjunction with the error cluster to produce a boolean output depending on if an error has occurred. If an error does occur, the function will produce a true and if an error does not occur it will produce a false. The error cluster can also be expanded by hovering the mouse over the top or bottom of the function and dragging the grey box up or down. This is useful for when you want to produce multiple outputs from the same data, such as the histogram data in your VI.
    Another thing I noticed in you code was some redundant logic. You had set the Stop button default on your front panel to true, which meant that an inverter had to be used to stop the first while loop and the stop condition in the last while loop had been changed to Continue if True. If you had kept the stop button default to False and the stop condition of the last while loop to Stop if True, the inverter on the first while loop would not be needed. This however is only a small issue but its something you could keep in mind when writing other code.
    Hopefully these suggestions will help you to further develop you LabVIEW code. I understand that implementing these suggestions into you current code could be an issue due to the size of it, but they are good features to consider when developing any code in the future. 
    If there is anything you are unsure of please do not hesitate to post any questions. I will be more than happy to assist you.
    Kind Regards 
    Jason W.
    Applications Engineer
    National Instruments UK & Ireland

  • Firefox 4.0 RC has huge memory leak + slow down problem

    Firefox 4.0 RC Seems to have a huge memory leak issue. After leaving the program open for around half an hour the RAM usage climbs to over 1 gb.
    However, I have 12 gb of physical ram, so firefox staking 1 gb for itself is not too big of a problem (and is probably a blessing as it means it's caching more data), but the problem is that the UI begins to slow down and become clunky after about 30 minutes.
    Browsing, switching tabs, even typing becomes jittery and not very responsive.
    This happens regardless of how many tabs I have open.
    Now it's also crashing every once in a while.

    Even with Firefox 4.0 (Release) running in Safe Mode, with all add-ons and themes disabled, I'm still inclined to think there's something screwy going on here.
    I was watching Page Faults/sec, Page File Bytes and Working Set in Performance Monitor and tailing the Privoxy log for requests. Even with Firefox minimized and "doing nothing" (making no requests, anyway), over the space of a 10 minute period the Working Set grew from 244,375,552 bytes to 274,939,004 bytes (averaging 50,939 bytes/second). This behaviour doesn't seem consistent though - sometimes it doesn't seem to grow at all.
    Additionally the Page Faults/Sec went nuts, accompanied by a step in Page File Bytes and Working Set, whenever a request got made to http://safebrowsing.clients.google.com/safebrowsing/downloads which seems to happens on a regular basis (approximately every 30 minutes).

  • OCI crash in Threaded mode.

    hey,
    I am trying to do this, using oci connect to a database in THREADED mode and after processing some selects and updates, close the connection. The application then sleeps for a few and connects again to the database.
    The issue is the app runs fine for few hours but then crashes without any error from ORACLE. The crash happens when the app tries to connect to Oracle to run a select.
    i have wrapped oci calls and use them as shared libs.
    * connect module - this is how i create the env and connect to db
    if (!oci_env_created) {
        r=OCIEnvCreate( &conn->env,
              OCI_DEFAULT |
              OCI_THREADED
            , 0, 0, 0, 0, 0, 0);
        if (r != OCI_SUCCESS) {
          strcpy(errmsg,"Could not create environment (OCIEnvCreate)";
          goto clean_up;
        oci_env_created = 1;
      OCIHandleAlloc(conn->env, (dvoid**)&conn->err, OCI_HTYPE_ERROR,   0, 0);
      OCIHandleAlloc(conn->env, (dvoid**)&conn->srv, OCI_HTYPE_SERVER,  0, 0);
      OCIHandleAlloc(conn->env, (dvoid**)&conn->svc, OCI_HTYPE_SVCCTX,  0, 0);
      OCIHandleAlloc(conn->env, (dvoid**)&conn->ses, OCI_HTYPE_SESSION, 0, 0);
    r=OCIServerAttach(conn->srv, conn->err, dbname, strlen((const char*)dbname), (ub4) OCI_DEFAULT);
      if (r != OCI_SUCCESS) {
        checkerr(conn->err, r, errmsg);
        goto clean_up;
        OCIAttrSet(conn->svc, OCI_HTYPE_SVCCTX, conn->srv, 0, OCI_ATTR_SERVER,  conn->err);
      OCIAttrSet(conn->ses, OCI_HTYPE_SESSION, username, strlen((const char*)username), OCI_ATTR_USERNAME, conn->err);
      OCIAttrSet(conn->ses, OCI_HTYPE_SESSION, password, strlen((const char*)password), OCI_ATTR_PASSWORD, conn->err);
      if ( (r=OCIAttrSet((dvoid *) conn->svc, (ub4) OCI_HTYPE_SVCCTX, (dvoid *) conn->ses, (ub4) 0, (ub4) OCI_ATTR_SESSION, conn->err)) ) {
        checkerr(conn->err, r,errmsg);
        goto clean_up;
      r=OCISessionBegin (conn->svc, conn->err, conn->ses, OCI_CRED_RDBMS, OCI_DEFAULT);
      if (r != OCI_SUCCESS) {
        checkerr(conn->err, r,errmsg);
        goto clean_up;
      }* following is the code for terminating the connection
    if ((r = OCIHandleFree((dvoid*) sh, (ub4) OCI_HTYPE_STMT))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
         if ((r = OCISessionEnd(conn->svc, conn->err, conn->ses, OCI_DEFAULT))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
        if ((r = OCIServerDetach(conn->srv, conn->err, OCI_DEFAULT))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
        if ((r = OCIHandleFree((dvoid*) conn->svc, (ub4) OCI_HTYPE_SVCCTX))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
        if ((r = OCIHandleFree((dvoid*) conn->srv, (ub4) OCI_HTYPE_SERVER))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
        if ((r = OCIHandleFree((dvoid*) conn->err, (ub4) OCI_HTYPE_ERROR))) {
          return 0;
        return 1;any insight is appreciated
    thanks

    Ok, i used GNU mcheck.h lib to check for memory leaks, could not find any. The only things i found was the app was using insanely high number of fd's, which has been fixed.
    But as far as the oci crash goes, still crashing,
    here's sudo of what i am doing
    main() {
    while(1)
       pthread_create (..., jobfunction()) //spawn new thread to process jobs
    jobfunction() {
       while(1) {
         /* Job code */
          oci_connect(...)
          oci_parse(sthdl1,...)
          oci_exec_update(sthdl1,...)
          oci_parse_execute("commit",.)
          oci_cleanup(sthdl1,...)
        /* More processing */
          oci_connect( )
          oci_parse(sthdl2, )
          oci_exec_update(sthdl2, )
          oci_parse_commit(sthdl2, )
          oci_cleanup(sthdl2, )
    }the oci wrappers:
    static int oci_env_created = 0;
    int oci_connect(
              text            username[31],
              text            password[31],
              text            dbname  [31],
       struct oci_connection* conn,
              char errmsg[512]
      sword r;
      if (!oci_env_created) {
        r=OCIEnvCreate( &conn->env,
              OCI_DEFAULT |
              OCI_THREADED
            , 0, 0, 0, 0, 0, 0);
        if (r != OCI_SUCCESS) {
          strcpy(errmsg,"Couldn't create environment (OCIEnvCreate)");
          goto clean_up;
        oci_env_created = 1;
       OCIHandleAlloc(conn->env, (dvoid**)&conn->err, OCI_HTYPE_ERROR,   0, 0);
      OCIHandleAlloc(conn->env, (dvoid**)&conn->srv, OCI_HTYPE_SERVER,  0, 0);
      OCIHandleAlloc(conn->env, (dvoid**)&conn->svc, OCI_HTYPE_SVCCTX,  0, 0);
      OCIHandleAlloc(conn->env, (dvoid**)&conn->ses, OCI_HTYPE_SESSION, 0, 0);
       /* Open connection to dbname */
      r=OCIServerAttach(conn->srv, conn->err, dbname, strlen((const char*)dbname), (ub4) OCI_DEFAULT);
      if (r != OCI_SUCCESS) {
        checkerr(conn->err, r, errmsg);
        goto clean_up;
      /* Set the server and logon using the username and password */
      OCIAttrSet(conn->ses, OCI_HTYPE_SESSION, username, strlen((const char*)username), OCI_ATTR_USERNAME, conn->err);
      OCIAttrSet(conn->ses, OCI_HTYPE_SESSION, password, strlen((const char*)password), OCI_ATTR_PASSWORD, conn->err);
      if ( (r=OCIAttrSet((dvoid *) conn->svc, (ub4) OCI_HTYPE_SVCCTX, (dvoid *) conn->ses, (ub4) 0, (ub4) OCI_ATTR_SESSION, conn->err)) ) {
        checkerr(conn->err, r,errmsg);
        goto clean_up;
      r=OCISessionBegin (conn->svc, conn->err, conn->ses, OCI_CRED_RDBMS, OCI_DEFAULT);
      if (r != OCI_SUCCESS) {
        checkerr(conn->err, r,errmsg);
        goto clean_up;
      return 1;
    clean_up:
       return 0;
    OCIStmt* oci_parse(
             char*           stmt,
             char            errmsg[512],
      struct oci_connection* conn ) {
      OCIStmt* sh;
      sword r;
      if (OCIHandleAlloc((dvoid *) conn->env, (dvoid **) &sh, (ub4) OCI_HTYPE_STMT, (size_t) 0, (dvoid **) 0)) {
        checkerr(conn->err, r, (text*)errmsg);
        return 0;
      if ((r=OCIStmtPrepare(sh, conn->err, (text*)(void*)stmt, (ub4) strlen((char *) stmt), (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT))) {
        checkerr(conn->err, r, (text*)errmsg);
        OCIHandleFree((dvoid *) sh, (ub4) OCI_HTYPE_STMT);
        return 0;
      return sh;
    int oci_execute_update(OCIStmt*          sh,
                     char*          errmsg,
                     struct oci_connection* conn,
                     int           count,
                     int           n_id) {
         OCIBind      *bnd1hp = (OCIBind*) 0;
         OCIBind          *bnd2hp = (OCIBind*) 0;
         sword          r;
         if ((r = OCIBindByPos(sh, &bnd1hp, conn->err, (ub4) 1, &count, sizeof(count), SQLT_INT,
                                 (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT))){
                 checkerr(conn->err, r, (text*)errmsg);
                    return 0;
            if ((r = OCIBindByPos(sh, &bnd2hp, conn->err, (ub4) 2, &n_id, sizeof(n_id), SQLT_INT,
                                 (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT))){
                     checkerr(conn->err, r, (text*)errmsg);
                     return 0;
            if ((r = OCIStmtExecute(conn->svc, sh, conn->err, (ub4) 1, (ub4) 0, (CONST OCISnapshot *) 0,
                                   (OCISnapshot *) 0, (ub4) OCI_DEFAULT))){
                     checkerr(conn->err, r, (text*)errmsg);
                     OCIHandleFree((dvoid *) sh, (ub4) OCI_HTYPE_STMT);
                     return 0;
         return 1;
    int oci_parse_and_execute(
             char*           stmt,
             char            errmsg[512],
      struct oci_connection* conn
      OCIStmt       *sh;
      sword r;
      if ((r=OCIHandleAlloc((dvoid *) conn->env, (dvoid **) &sh, (ub4) OCI_HTYPE_STMT, (size_t) 0, (dvoid **) 0))) {
        checkerr(conn->err, r, (text*)errmsg);
        return 0;
      if ((r=OCIStmtPrepare(sh, conn->err, (text*)(void*)stmt, (ub4) strlen((char *) stmt), (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT))) {
        checkerr(conn->err, r, (text*)errmsg);
        OCIHandleFree((dvoid *) sh, (ub4) OCI_HTYPE_STMT);
        return 0;
      if ((r=OCIStmtExecute(conn->svc, sh, conn->err, (ub4) 1, (ub4) 0, (CONST OCISnapshot *) 0, (OCISnapshot *) 0, (ub4) OCI_DEFAULT))) {
        checkerr(conn->err, r, (text*)errmsg);
        OCIHandleFree((dvoid *) sh, (ub4) OCI_HTYPE_STMT);
        return 0;
      OCIHandleFree((dvoid *) sh, (ub4) OCI_HTYPE_STMT);
      return 1;
    int oci_cleanup(OCIStmt* sh, struct oci_connection* conn, char errmsg[512]) {
      sb4 r;
      //if (conn->env) {
         if ((r = OCIHandleFree((dvoid*) sh, (ub4) OCI_HTYPE_STMT))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
         if ((r = OCISessionEnd(conn->svc, conn->err, conn->ses, OCI_DEFAULT))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
        if ((r = OCIServerDetach(conn->srv, conn->err, OCI_DEFAULT))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
         if ((r = OCIHandleFree((dvoid*) conn->ses, (ub4) OCI_HTYPE_SESSION))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
        if ((r = OCIHandleFree((dvoid*) conn->svc, (ub4) OCI_HTYPE_SVCCTX))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
        if ((r = OCIHandleFree((dvoid*) conn->srv, (ub4) OCI_HTYPE_SERVER))) {
          checkerr(conn->err, r, (text*)errmsg);
          return 0;
        if ((r = OCIHandleFree((dvoid*) conn->err, (ub4) OCI_HTYPE_ERROR))) {
          return 0;
        return 1;
    // return 0;
    }

Maybe you are looking for

  • Unable to launch Mail.app get a message  - mail quit unexpectedly

    Since last couple of days, every time try to open mail app it quits and gives me the error message. Have tried rebooting the system, no result. I have pasted the error report, hope someone can help me on this please. Process: Mail [608] Path: /Applic

  • Job_open

    Hi ,     i am running CC11 transaction in the background using the below code, i have created a BDC for the transaction and trying to run this in the background , the log(SM37) is showing the sucess message but the revision is not done.     CALL FUNC

  • Is there a way to make the bookmarks in Safari icons as opposed to text?

    Was just wondering if there was a way to replace the text on the bookmarks bar with just an icon representing the page, as I would like to fit more bookmarks on and prefer the look overall

  • Short dump while executing few queries , which has got created on Infoset.

    Hi, We went to BI7.0 upgrade from BW3.x now. We are getting short dump short dump while executing few queries and work book, which has got created on Infoset. When i was executing work book where i was geting popup message saying that "Erro ZSD_XST_F

  • Doubt in creation of LSMW

    Hi experts, We have a requirements where the LSMW for infotype 22 should be run for a PERNR only if IT-0001 and IT-0002 are maintained. How to do this? Remember the requirement is only for LSMW and not a BDC.