Oracle AQAPI causing memory leakage

Good day
I am having a memory leakage on my production server which degrades and eventually dies, the cause is a job that is executed every five minutes which polls the Oracle Queue using the AQAPI. I can see that garbage collector is attempting to finalize() the AQOracleQueue, but this object is waiting on a lock.
My code is as follows:
package com.strysie.aq;
import java.sql.Connection;
import oracle.AQ.AQDequeueOption;
import oracle.AQ.AQDriverManager;
import oracle.AQ.AQMessage;
import oracle.AQ.AQQueue;
import oracle.AQ.AQSession;
*public class QueueDAO {*
*public QueuePayload dequeueMsg() throws Exception {*
AQSession session = null;
AQQueue queue = null;
Connection connection = null;
*try {*
connection = connectionFromPool();
connection.setAutoCommit(false);
session = AQDriverManager.createAQSession(connection);
queue = session.getQueue("mySchemaName", "myQueueName");
AQDequeueOption dequeueOption = new AQDequeueOption();
dequeueOption.setConsumerName("myConsumerName");
String browseMode = System.getProperty("AQBrowseOrDequeue");
*if (browseMode.compareToIgnoreCase("Dequeue") != 0) {*
dequeueOption.setDequeueMode(AQDequeueOption.DEQUEUE_BROWSE);
AQMessage message = queue.dequeue(dequeueOption, new QueuePayload());
return (QueuePayload) message.getObjectPayload().getPayloadData();
*} catch (Exception ex) {*
throw ex;
*} finally {*
*try {*
*if (queue != null) {*
queue.close();
*} catch (Exception e) {*
e.printStackTrace();
*try {*
*if (session != null) {*
session.close();
*} catch (Exception e) {*
e.printStackTrace();
*try {*
*if (connection != null) {*
connection.commit();
*} catch (Exception e) {*
e.printStackTrace();
returnToPool(connection);
*private Connection connectionFromPool() {*
Connection connection = null;
*// fetch connection from pool*
return connection;
*private void returnToPool(Connection connection) {*
*// return connection to pool*
package com.strysie.aq;
import java.math.BigDecimal;
import java.sql.SQLException;
import oracle.jdbc.driver.OracleConnection;
import oracle.sql.CustomDatum;
import oracle.sql.CustomDatumFactory;
import oracle.sql.Datum;
import oracle.sql.STRUCT;
import oracle.sql.StructDescriptor;
*public class QueuePayload implements CustomDatum, CustomDatumFactory {*
public String account;
public BigDecimal amount;
static final QueuePayload message_t_Factory = new QueuePayload(null, null);
*public static CustomDatumFactory getFactory() {*
return message_t_Factory;
*public QueuePayload() {*
*public QueuePayload(String account_number, BigDecimal amount) {*
this.account = account_number;
this.amount = amount;
*public Datum toDatum(OracleConnection c) throws SQLException {*
StructDescriptor sd = StructDescriptor.createDescriptor("QUEUEPAYLOAD", c);
*Object[] attributes = { account, amount};*
return new STRUCT(sd, c, attributes);
*public CustomDatum create(Datum d, int sqlType) throws SQLException {*
*if (d == null) {*
return null;
Object[] attributes = ((STRUCT) d).getAttributes();
return new QueuePayload((String) attributes[0], (BigDecimal) attributes[1]);
** @return the account_number*
*public String getAccount() {*
return this.account;
** @return the amount*
*public BigDecimal getAmount() {*
return this.amount;
** @param account_number*
** the account_number to set*
*public void setAccount(String account_number) {*
this.account = account_number;
** @param amount*
** the amount to set*
*public void setAmount(BigDecimal amount) {*
this.amount = amount;
When I extract a thread dump I encounter the following on the Finalizer thread:
*"Finalizer" daemon prio=10 tid=0x00002aaab31c7800 nid=0x7469 waiting for monitor entry [0x0000000040a32000]*
java.lang.Thread.State: BLOCKED (on object monitor)
at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:1341)
- waiting to lock <0x00000007b0745288> (a oracle.jdbc.driver.T4CConnection)
at oracle.AQ.AQOracleQueue.close(AQOracleQueue.java:3225)
at oracle.AQ.AQOracleQueue.finalize(AQOracleQueue.java:3364)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
Please assist.
Best regards
Rudi

Can only 'guess' since the code is missing that shows how the connection and statement instances are being created, pooled and used.
Your code is not setting the 'wait' option for the dequeue and the default is DEQUEUE_WAIT_FOREVER for a message. So my 'guess' is that an instance of the code you show is 'waiting' for a message and keeping it's connection and statement open and then another thread is trying to use that connection and it is locked or another thread is trying to shutdown the application when the problem appears.
See Dequeuing Messages in the JDBC Developer's Guide
http://docs.oracle.com/cd/B28359_01/java.111/b31224/streamsaq.htm#BABJGBBA
>
•Wait: Specifies the wait time for the dequeue operation, if none of the messages matches the search criteria. The default value is DEQUEUE_WAIT_FOREVER indicating that the operation waits forever. If set to DEQUEUE_NO_WAIT, then the operation does not wait. If a number is specified, then the dequeue operation waits for the specified number of seconds.
>
Try setting the 'wait' option to DEQUEUE_NO_WAIT or to a number of seconds and see if the problem reoccurs.
NOTE: If this problem is occuring because another thread is trying to use this same connection when it is locked it probably means you have a problem in your connection pooling code since it would mean the connection pool is allowing another thread to use a connection that is already being used.

Similar Messages

  • XML parser causes memory leakage, help!

    I have the following function which called by other package to transfer xml. But every time it is called oracle will consume 600 to 700k memory and never release them. Any thought about it?
    Function Transform(xml Clob,xsl Clob) Return Clob is
    p xmlparser.Parser;
    xmldoc xmldom.DOMDocument;
    xsldoc xmldom.DOMDocument;
    proc xslprocessor.Processor;
    ss xslprocessor.Stylesheet;
    cl Clob;
    begin
    p := xmlparser.newParser;
    xmlparser.setValidationMode(p, FALSE);
    xmlparser.setPreserveWhiteSpace(p, TRUE);
    xmlparser.parseClob(p, xml); -- parse xml
    xmldoc := xmlparser.getDocument(p);
    xmlparser.parseClob(p, xsl); -- parse xsl
    xsldoc := xmlparser.getDocument(p);
    proc := xslprocessor.newProcessor;
    ss := xslprocessor.newStylesheet(xsldoc, '');
    dbms_lob.createtemporary(cl, TRUE);
    xslprocessor.processXSL(proc, ss, xmldoc,cl);
    xslprocessor.freeProcessor(proc);
    xslprocessor.freeStyleSheet(ss);
    xmlparser.freeParser(p);
    return cl;
    exception -- deal with exceptions
    when xmldom.INDEX_SIZE_ERR then
    raise_application_error(-20120, 'Index Size error');
    when xmldom.DOMSTRING_SIZE_ERR then
    raise_application_error(-20120, 'String Size error');
    when xmldom.HIERARCHY_REQUEST_ERR then
    raise_application_error(-20120, 'Hierarchy request error');
    when xmldom.WRONG_DOCUMENT_ERR then
    raise_application_error(-20120, 'Wrong doc error');
    when xmldom.INVALID_CHARACTER_ERR then
    raise_application_error(-20120, 'Invalid Char error');
    when xmldom.NO_DATA_ALLOWED_ERR then
    raise_application_error(-20120, 'Nod data allowed error');
    when xmldom.NO_MODIFICATION_ALLOWED_ERR then
    raise_application_error(-20120, 'No mod allowed error');
    when xmldom.NOT_FOUND_ERR then
    raise_application_error(-20120, 'Not found error');
    when xmldom.NOT_SUPPORTED_ERR then
    raise_application_error(-20120, 'Not supported error');
    when xmldom.INUSE_ATTRIBUTE_ERR then
    raise_application_error(-20120, 'In use attr error');
    end Transform;
    null

    Would you try to free the alloced temporary lob whenever get Exception and try?
    dbms_lob.createtemporary(cl, TRUE);
    dbms_lob.freetemporary(cl);
    Thanks.
    null

  • Memory leakage with oracle oci driver

    I have developed a Solaris8 client/server application using the JAVA IDL CORBA implementation. The client sends requests to the server to update the database (database is Oracle 8.1.7 and I connect to it using oci oracle drivers). Requests are sent one at a time. No concurrent connections. I have a static connection that I establish with database once I start the server. If that connection is lost for any reason (timeout or database faliure) the application tries automatically to reconnect to database. I have noticed that if the new connection to database fails and an sql exception is thrown, memory used by the application process increases. This memory is not garbage collected so application hangs. I tried similar behaviour with the oracle thin driver and things went fine. There was no memory leakage.
    I would really appreciate, if you can help me in this since I can't use the thin driver because of failover limitations.

    I have noticed
    that if the new connection to database fails and an
    sql exception is thrown, memory used by the
    application process increases.
    How have you noticed this?I noticed this using the command pmap under solaris it operating system
    every time I test reconnecting to database I go and check the memory used by the application before after attepmting to reconnect:
    /usr/proc/bin/pmap [myapp pid] | tail -1
    If I'm using normal connection then the memory will be increased by 100KB. If I'm using the OraclePooledConnection class then the increase will be something like 500KB. Again this is if still there is a problem connecting to database. If connection to database is okay then no memory increase at all.
    This memory is not
    garbage collected so application hangs.
    Then it isn't a java problem. When java runs out of memory it throws a out of memory exception.Well I'm not saying it is a java problem for sure. I suspect that it might be oracle oci8 driver problem. I would appreciate if anyone can help in specifying teh source of the error.
    I tried
    similar behaviour with the oracle thin driver and
    things went fine. There was no memory leakage.
    I would really appreciate, if you can help me in this
    since I can't use the thin driver because of failover
    limitations.
    I don't understand that last sentence at all.What I mean here is that instead of using the oci8 driver to connect to database I used the thin driver and kept everything else the same. I simulated the faliure to reconnect to database and based on the pmap command observations there was no memory leakage.
    I want to know what is needed to be done in order to get a normal behavior once using the oci8 drivers.

  • Memory leakage issue in Oracle-DOTNET environment

    Hi,
    One of my customer is facing a issue of memory leakage issue with their ASP.NET application. Following are the environment details
    1. ASP.NET 3.5 application (Uses some Infragistics controls for grids)
    2. SSRS for reporting
    3. Oracle Server as database (details given below)
    The memory leakage occurs while running load testing in his test environment.
    The memory is consumed (in tune of 1.2 GB) and then performance is hit.
    The memory dump is analyzed and we found Oracle client eating up a lot of memory which is not released.
    We tried to use 11g driver also but without any improvements.
    Environment Details :
    1. Oracle server version –
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 – Production
    2. Client version
    We are using following oracle client version SQL*Plus: Release 10.2.0.1.0 – Production
    (For performance purpose we have used following client version. SQL*Plus: Release 11.1.0.7.0 – Production)
    3. ODP.NET version
    Version of Oracle.DataAccess.dll is 2.111.7.10
    It will be great if any body can help on this issue and guide us on the right track.
    Thanks in advance.
    Thanks & Regards,
    Anoop

    Please test it with release version as there may be a lot of things which are fixed after beta.
    Also please note down the statement cache size your application was using earlier. Starting from 2.111.7.10/2.111.7.20, the statement cache size is automatically tuned by default. This feature is called self tuning. You may disable self tuning and specify your own statement cache size as usual. To know more about self tuning, please consult ODP.NET Developer's Guide.
    I would suggest that you first upgrade to the release version 2.111.7.20. If that does not solve the problem, you may either
    - specify MaxStatementCacheSize
    or
    - disable self tuning and provide your own statement cache size

  • Stand alone weblogic keeps running out of memory ! Cause of Memory Leakage?

    Hi all,
    I have a machine with 16gb ram and 500gb hard disk with linux os. I have installed weblogic server in it with an adf application deployed on it. So now the problem every two weeks the machine keeps running out of memory . Could it be because of connection leakage ?
    There are only a couple of people accessing the application time and again.
    When i checked for the data source connection count in weblogic server under data sources , it mostly shows around 10 - 20 connections.
    What are various reasons for leakage of connection in ADF application ?
    I have not made any explicit jdbc calls in our application .
    There is a couple of PL/SQL calls to an external api(this is done in the application module) through db links and rest all is just plain accessing of application modules and view objects .
    So what could be the reason if any memory leakage is occuring ?
    My application module configuration is
      <AppModuleConfigBag ApplicationName="model.am.AuthenticationAM">
          <AppModuleConfig jbo.project="model.Model" DeployPlatform="LOCAL" name="AuthenticationAMLocal" ApplicationName="model.am.AuthenticationAM">
             <AM-Pooling jbo.ampool.maxinactiveage="300000" jbo.ampool.initpoolsize="44" jbo.ampool.maxpoolsize="60" jbo.recyclethreshold="40" jbo.ampool.minavailablesize="0" jbo.ampool.monitorsleepinterval="120000"/>
             <Database jbo.locking.mode="optimistic" jbo.TypeMapEntries="OracleApps"/>
             <Security AppModuleJndiName="model.am.AuthenticationAM"/>
             <Custom JDBCDataSource="java:comp/env/jdbc/ConnectionDBDS" jbo.rowid_am_datasource_name="java:comp/env/jdbc/ROWIDAM_DBDS"/>Thanks in advance
    Sam
    Edited by: Sam47 on 19-Oct-2012 01:46

    Hi Suspito ,
    Thanks for the link ..
    Is that the standard configuration for weblogic server?
    If at all there are connection leaks in the application in the weblogic server under datasource will it show the count of all the database connection open ?
    -Sam

  • Memory Leakage while parsing and schema validation

    It seems there is some kind of memory leakage. I was using xdk 9.2.0.2.0. Later i found that from this forum which contain a Topic on this and they (oracle ) claim they have memory leakage. And they have fixes this bugs in 9.2.0.6.0 xdk. When i used truss command, for each call to parser and schame validation, it was opening file descriptor for lpxus and lsxus file. And this connections were not close. And keep on openning it with each call to parser. I was able to diagonise this using truss command on on solaris. After making many calls, i was error message could not open file Result.xsd (0202). I am using one instance of Parser and Schema. And i am doing clean up for parser after each parse.
    Later i downloaded, 9.2.0.6.0,
    Above problem for the parser was solvedm but still the problem continued for schema validation. And even i tried with latest beta release 10.
    And this has caused great troubles to us. Please can u look whether there is come sort of leakage. Please advice if u have any solution.
    Code---
    This below code is called multiple times
    char* APIParser::execute(const char* xmlInput) {
              char* parseResult = parseDocument(xmlInput);
              //if(strcmp(parseResult,(const char*)"")==0) {
    if(parseResult == NULL) {
                   parseResult = getResult();
    parser.xmlclean();
         return parseResult;
              } else {
                   return parseResult;
    Parser and schema are intialised in Construtor and terminated in Destructor.

    Hi, here is the complete test case
    #include<iostream>
    #ifndef ORAXML_CPP_ORACLE
    # include <oraxml.hpp>
    #endif
    using namespace std;
    #define FAIL { cout << "Failed!\n"; return ; }
    void mytest(int count)
         uword ecode;
         XMLParser parser;
         Document *doc;
         Element root, elem;
         if (ecode = parser.xmlinit())
              cout << "Failed to initialze XML parser, error " << ecode << "\n";
              return ;
         cout << "\nCreating new document...\n";
         if (!(doc = parser.createDocument((oratext *) 0, (oratext *) 0,(DocumentType *) 0)))
         FAIL
         if (!(elem = doc->createElement((oratext *) "ROOT")))
                   FAIL
         string test="Elem";
         for(int i=0;i<count;i++)
              //test="Elem"+string(ltoa(i));
              if (!(elem = doc->createElement((oratext *) "element")))
                   FAIL
              if (!doc->appendChild(elem))
                   FAIL
         //doc ->print();
         //parser.xmlclean();
         parser.xmlterm();
    int main(int argc,char* argv[])
         int count=atol(argv[1]);
         mytest(count);
         char c;
         cout<<"check memory usage n press any key"<<endl;
         cin>>c;
         return 0;
    -------------------------------------------cut here-----
    Now, i cant use the xdk 10g because i work on a hpux machine. I have tried the above program with a count of 1000000. the memory usage at the end was around 2 gigabytes.
    Could someone please please help me? :(
    Thank you.

  • Pre-loading Oracle text in memory with Oracle 12c

    There is a white paper from Roger Ford that explains how to load the Oracle index in memory : http://www.oracle.com/technetwork/database/enterprise-edition/mem-load-082296.html
    In our application, Oracle 12c, we are indexing a big XML field (which is stored as XMLType with storage secure file) with the PATH_SECTION_GROUP. If I don't load the I table (DR$..$I) into memory using the technique explained in the white paper then I cannot have decent performance (and especially not predictable performance, it looks like if the blocks from the TOKEN_INFO columns are not memory then performance can fall sharply)
    But after migrating to oracle 12c, I got a different problem, which I can reproduce: when I create the index it is relatively small (as seen with ctx_report.index_size) and by applying the technique from the whitepaper, I can pin the DR$ I table into memory. But as soon as I do a ctx_ddl.optimize_index('Index','REBUILD') the size becomes much bigger and I can't pin the index in memory. Not sure if it is bug or not.
    What I found as work-around is to build the index with the following storage options:
    ctx_ddl.create_preference('TEST_STO','BASIC_STORAGE');
    ctx_ddl.set_attribute ('TEST_STO', 'BIG_IO', 'YES' );
    ctx_ddl.set_attribute ('TEST_STO', 'SEPARATE_OFFSETS', 'NO' );
    so that the token_info column will be stored in a secure file. Then I can change the storage of that column to put it in the keep buffer cache, and write a procedure to read the LOB so that it will be loaded in the keep cache. The size of the LOB column is more or less the same as when creating the index without the BIG_IO option but it remains constant even after a ctx_dll.optimize_index. The procedure to read the LOB and to load it into the cache is very similar to the loaddollarR procedure from the white paper.
    Because of the SDATA section, there is a new DR table (S table) and an IOT on top of it. This is not documented in the white paper (the white paper was written for Oracle 10g). In my case this DR$ S table is much used, and the IOT also, but putting it in the keep cache is not as important as the token_info column of the DR I table. A final note: doing SEPARATE_OFFSETS = 'YES' was very bad in my case, the combined size of the two columns is much bigger than having only the TOKEN_INFO column and both columns are read.
    Here is an example on how to reproduce the problem with the size increasing when doing ctx_optimize
    1. create the table
    drop table test;
    CREATE TABLE test
    (ID NUMBER(9,0) NOT NULL ENABLE,
    XML_DATA XMLTYPE
    XMLTYPE COLUMN XML_DATA STORE AS SECUREFILE BINARY XML (tablespace users disable storage in row);
    2. insert a few records
    insert into test values(1,'<Book><TITLE>Tale of Two Cities</TITLE>It was the best of times.<Author NAME="Charles Dickens"> Born in England in the town, Stratford_Upon_Avon </Author></Book>');
    insert into test values(2,'<BOOK><TITLE>The House of Mirth</TITLE>Written in 1905<Author NAME="Edith Wharton"> Wharton was born to George Frederic Jones and Lucretia Stevens Rhinelander in New York City.</Author></BOOK>');
    insert into test values(3,'<BOOK><TITLE>Age of innocence</TITLE>She got a prize for it.<Author NAME="Edith Wharton"> Wharton was born to George Frederic Jones and Lucretia Stevens Rhinelander in New York City.</Author></BOOK>');
    3. create the text index
    drop index i_test;
      exec ctx_ddl.create_section_group('TEST_SGP','PATH_SECTION_GROUP');
    begin
      CTX_DDL.ADD_SDATA_SECTION(group_name => 'TEST_SGP', 
                                section_name => 'SData_02',
                                tag => 'SData_02',
                                datatype => 'varchar2');
    end;
    exec ctx_ddl.create_preference('TEST_STO','BASIC_STORAGE');
    exec  ctx_ddl.set_attribute('TEST_STO','I_TABLE_CLAUSE','tablespace USERS storage (initial 64K)');
    exec  ctx_ddl.set_attribute('TEST_STO','I_INDEX_CLAUSE','tablespace USERS storage (initial 64K) compress 2');
    exec  ctx_ddl.set_attribute ('TEST_STO', 'BIG_IO', 'NO' );
    exec  ctx_ddl.set_attribute ('TEST_STO', 'SEPARATE_OFFSETS', 'NO' );
    create index I_TEST
      on TEST (XML_DATA)
      indextype is ctxsys.context
      parameters('
        section group   "TEST_SGP"
        storage         "TEST_STO"
      ') parallel 2;
    4. check the index size
    select ctx_report.index_size('I_TEST') from dual;
    it says :
    TOTALS FOR INDEX TEST.I_TEST
    TOTAL BLOCKS ALLOCATED:                                                104
    TOTAL BLOCKS USED:                                                      72
    TOTAL BYTES ALLOCATED:                                 851,968 (832.00 KB)
    TOTAL BYTES USED:                                      589,824 (576.00 KB)
    4. optimize the index
    exec ctx_ddl.optimize_index('I_TEST','REBUILD');
    and now recompute the size, it says
    TOTALS FOR INDEX TEST.I_TEST
    TOTAL BLOCKS ALLOCATED:                                               1112
    TOTAL BLOCKS USED:                                                    1080
    TOTAL BYTES ALLOCATED:                                 9,109,504 (8.69 MB)
    TOTAL BYTES USED:                                      8,847,360 (8.44 MB)
    which shows that it went from 576KB to 8.44MB. With a big index the difference is not so big, but still from 14G to 19G.
    5. Workaround: use the BIG_IO option, so that the token_info column of the DR$ I table will be stored in a secure file and the size will stay relatively small. Then you can load this column in the cache using a procedure similar to
    alter table DR$I_TEST$I storage (buffer_pool keep);
    alter table dr$i_test$i modify lob(token_info) (cache storage (buffer_pool keep));
    rem: now we must read the lob so that it will be loaded in the keep buffer pool, use the prccedure below
    create or replace procedure loadTokenInfo is
      type c_type is ref cursor;
      c2 c_type;
      s varchar2(2000);
      b blob;
      buff varchar2(100);
      siz number;
      off number;
      cntr number;
    begin
        s := 'select token_info from  DR$i_test$I';
        open c2 for s;
        loop
           fetch c2 into b;
           exit when c2%notfound;
           siz := 10;
           off := 1;
           cntr := 0;
           if dbms_lob.getlength(b) > 0 then
             begin
               loop
                 dbms_lob.read(b, siz, off, buff);
                 cntr := cntr + 1;
                 off := off + 4096;
               end loop;
             exception when no_data_found then
               if cntr > 0 then
                 dbms_output.put_line('4K chunks fetched: '||cntr);
               end if;
             end;
           end if;
        end loop;
    end;
    Rgds, Pierre

    I have been working a lot on that issue recently, I can give some more info.
    First I totally agree with you, I don't like to use the keep_pool and I would love to avoid it. On the other hand, we have a specific use case : 90% of the activity in the DB is done by queuing and dbms_scheduler jobs where response time does not matter. All those processes are probably filling the buffer cache. We have a customer facing application that uses the text index to search the database : performance is critical for them.
    What kind of performance do you have with your application ?
    In my case, I have learned the hard way that having the index in memory (the DR$I table in fact) is the key : if it is not, then performance is poor. I find it reasonable to pin the DR$I table in memory and if you look at competitors this is what they do. With MongoDB they explicitly says that the index must be in memory. With elasticsearch, they use JVM's that are also in memory. And effectively, if you look at the awr report, you will see that Oracle is continuously accessing the DR$I table, there is a SQL similar to
    SELECT /*+ DYNAMIC_SAMPLING(0) INDEX(i) */    
    TOKEN_FIRST, TOKEN_LAST, TOKEN_COUNT, ROWID    
    FROM DR$idxname$I
    WHERE TOKEN_TEXT = :word AND TOKEN_TYPE = :wtype    
    ORDER BY TOKEN_TEXT,  TOKEN_TYPE,  TOKEN_FIRST
    which is continuously done.
    I think that the algorithm used by Oracle to keep blocks in cache is too complex. A just realized that in 12.1.0.2 (was released last week) there is finally a "killer" functionality, the in-memory parameters, with which you can pin tables or columns in memory with compression, etc. this looks ideal for the text index, I hope that R. Ford will finally update his white paper :-)
    But my other problem was that the optimize_index in REBUILD mode caused the DR$I table to double in size : it seems crazy that this was closed as not a bug but it was and I can't do anything about it. It is a bug in my opinion, because the create index command and "alter index rebuild" command both result in a much smaller index, so why would the guys that developped the optimize function (is it another team, using another algorithm ?) make the index two times bigger ?
    And for that the track I have been following is to put the index in a 16K tablespace : in this case the space used by the index remains more or less flat (increases but much more reasonably). The difficulty here is to pin the index in memory because the trick of R. Ford was not working anymore.
    What worked:
    first set the keep_pool to zero and set the db_16k_cache_size to instead. Then change the storage preference to make sure that everything you want to cache (mostly the DR$I) table come in the tablespace with the non-standard block size of 16k.
    Then comes the tricky part : the pre-loading of the data in the buffer cache. The problem is that with Oracle 12c, Oracle will use direct_path_read for FTS which basically means that it bypasses the cache and read directory from file to the PGA !!! There is an event to avoid that, I was lucky to find it on a blog (I can't remember which, sorry for the credit).
    I ended-up doing that. the events to 10949 is to avoid the direct path reads issue.
    alter session set events '10949 trace name context forever, level 1';
    alter table DR#idxname0001$I cache;
    alter table DR#idxname0002$I cache;
    alter table DR#idxname0003$I cache;
    SELECT /*+ FULL(ITAB) CACHE(ITAB) */ SUM(TOKEN_COUNT),  SUM(LENGTH(TOKEN_INFO)) FROM DR#idxname0001$I;
    SELECT /*+ FULL(ITAB) CACHE(ITAB) */ SUM(TOKEN_COUNT),  SUM(LENGTH(TOKEN_INFO)) FROM DR#idxname0002$I;
    SELECT /*+ FULL(ITAB) CACHE(ITAB) */ SUM(TOKEN_COUNT),  SUM(LENGTH(TOKEN_INFO)) FROM DR#idxname0003$I;
    SELECT /*+ INDEX(ITAB) CACHE(ITAB) */  SUM(LENGTH(TOKEN_TEXT)) FROM DR#idxname0001$I ITAB;
    SELECT /*+ INDEX(ITAB) CACHE(ITAB) */  SUM(LENGTH(TOKEN_TEXT)) FROM DR#idxname0002$I ITAB;
    SELECT /*+ INDEX(ITAB) CACHE(ITAB) */  SUM(LENGTH(TOKEN_TEXT)) FROM DR#idxname0003$I ITAB;
    It worked. With a big relief I expected to take some time out, but there was a last surprise. The command
    exec ctx_ddl.optimize_index(idx_name=>'idxname',part_name=>'partname',optlevel=>'REBUILD');
    gqve the following
    ERROR at line 1:
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in drftoptrebxch
    ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.CTX_DDL", line 1141
    ORA-06512: at line 1
    Which is very much exactly described in a metalink note 1645634.1 but in the case of a non-partitioned index. The work-around given seemed very logical but it did not work in the case of a partitioned index. After experimenting, I found out that the bug occurs when the partitioned index is created with  dbms_pclxutil.build_part_index procedure (this enables  enables intra-partition parallelism in the index creation process). This is a very annoying and stupid bug, maybe there is a work-around, but did not find it on metalink
    Other points of attention with the text index creation (stuff that surprised me at first !) ;
    - if you use the dbms_pclxutil package, then the ctx_output logging does not work, because the index is created immediately and then populated in the background via dbms_jobs.
    - this in combination with the fact that if you are on a RAC, you won't see any activity on the box can be very frightening : this is because oracle can choose to start the workers on the other node.
    I understand much better how the text indexing works, I think it is a great technology which can scale via partitioning. But like always the design of the application is crucial, most of our problems come from the fact that we did not choose the right sectioning (we choosed PATH_SECTION_GROUP while XML_SECTION_GROUP is so much better IMO). Maybe later I can convince the dev to change the sectionining, especially because SDATA and MDATA section are not supported with PATCH_SECTION_GROUP (although it seems to work, even though we had one occurence of a bad result linked to the existence of SDATA in the index definition). Also the whole problematic of mixed structured/unstructured searches is completly tackled if one use XML_SECTION_GROUP with MDATA/SDATA (but of course the app was written for Oracle 10...)
    Regards, Pierre

  • JSF: partial page rendering is causing memory leak leading to outofmemory

    JDeveloper 10.1.3.2.0
    JDK: 1.6.0_06
    Operating System: Windows XP.
    I test my application for memory leaks. For that purpose, I use jconsole to monitor java heap space. I have an edit page that has two dependent list components. One displays all countries and the other displays cities of the selected country.
    I noticed java heap space keeps growing as I change country from country list.
    I run garbage collection and memory usage does not go down. If I keep changing the province for 5 minutes, then I hit a java heap space outofmemory exception.
    To narrow down the problem, I removed the second city component and the problem still exists.
    To narrow it down further, I removed autosubmit attribute from the country component and then memory usage stopped increasing as I change country.
    country/city partial page rendering is just an example. I am able to reproduce the same problem on every page where i use partial page rendering. My conclusion is PPR is causing memory leak or at least the autosubmit attribute.
    This is really bad. Anyone out there experienced same issue. Any help/advice is highly appreciated !!
    Thanks
    <af:panelLabelAndMessage
    inlineStyle="font-weight:bold;"
    label="Country:"
    tip=" "
    showRequired="true"
    for="CountryId">
    <af:selectOneChoice id="CountryId"
                   valuePassThru="true"
                   value="#{bindings.CountryId.inputValue}"
                   autoSubmit="true"
                   inlineStyle="width:221px"
                   simple="true">
         <af:forEach var="item"
              items="#{bindings.CountriesListIterator.allRowsInRange}">
         <af:selectItem value="#{item.countryId}"
                   label="#{item.countryName}"/>
         </af:forEach>
    </af:selectOneChoice>
    </af:panelLabelAndMessage>
    <af:panelLabelAndMessage
    inlineStyle="font-weight:bold;"
    label="City:"
    tip=" "
    showRequired="true"
    for="CityId">
    <af:selectOneChoice id="CityId"
                   valuePassThru="true"
                   value="#{bindings.CityId.inputValue}"
                   partialTriggers="CountryId"
                   autoSubmit="true"
                   inlineStyle="width:221px"
                   unselectedLabel="--Select City--"
                   simple="true">
         <f:selectItems value="#{backing_CountryCityBean.citiesSelectItems}"/>
    </af:selectOneChoice>
    </af:panelLabelAndMessage>

    Samsam,
    I haven't seen this problem myself, no.
    To clarify - are you seeing this behaviour when running your app in JDeveloper, or when running in an application server? If in JDeveloper, a copuple of suggestions:
    * (may not matter, but...) It's not supported to run JDev 10g with JDK 6
    * have you tried the [url http://www.oracle.com/technology/pub/articles/masterj2ee/j2ee_wk11.html]memory profiler
    Best,
    John

  • Oracle 9i client memory leak?

    Hi
    Very recently we upgraded our oracle client from 8i to 9i (9.2.0.4.0), One of out NT services which was built with 8i client libraries now rebuilt with 9i client libraries and put into production. However now we see huge memory increase of that service. Normally it should be consistent and when the load goes down it memory usage should drop down. but in this case within 1hr it will increased up to 850MB. Our code didn't change.
    So we're suspecting is there any know memory leak issue in 9i client libraries. if so what is the fix for it.
    Also if I try to find the process info of our service, I found there are lot of opened file handles for following files
    D:\oracle\ora92\xdk\mesg\lpxus.msb
    sometimes more than 2500 handles
    again I tried with our service compiled with 8i client and ran under 8i client environment, then maximum number of handles opened to this file is under 20-30 and just after the load gone away it droped down to 1.
    Pleas help me on this issue

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

  • Memory leakage issue in Solaris

    Hi Team,
    Hope you doing good!!
    I am facing a memory leakage issue in the Solaris server configured.
    details:
    1. Frequent Increase in Memory Utilization
    2. Major Faults in System Events 189084 & Increasing.
    Server cofg.:
    Solaris 9 version 5.9,Sun Java Web Server 6.1,JDK 1.5,Oracle 10g.
    I really appreciate if you give conclusion for the above behavior of server ASAP.
    Thanks,
    Vivek
    +919990550305

    Please test it with release version as there may be a lot of things which are fixed after beta.
    Also please note down the statement cache size your application was using earlier. Starting from 2.111.7.10/2.111.7.20, the statement cache size is automatically tuned by default. This feature is called self tuning. You may disable self tuning and specify your own statement cache size as usual. To know more about self tuning, please consult ODP.NET Developer's Guide.
    I would suggest that you first upgrade to the release version 2.111.7.20. If that does not solve the problem, you may either
    - specify MaxStatementCacheSize
    or
    - disable self tuning and provide your own statement cache size

  • Memory leakage in Swing application using hash table to retrive data

    Hi I have developed one application using swing , I am using hashtable to retrieve data from database . but that cause me problem my size of application increases automatically for every click in the application.I think memory leakage is there.
    would anybody help me to remove this error

    Hi I have developed one application using swing , I am using hashtable to retrieve data from database . but that cause me problem my size of application increases automatically for every click in the application.I think memory leakage is there.
    would anybody help me to remove this error

  • Memory Leakage Detection

    Hi,
    Want to know how can I detect any memory leakage using any profiler. There are so many links on the net but there is no simple documentation on net that gives simple steps to detect any memory leakage.
    Also most profilers do not show how many Garbage Collections an object has survived. This information could be critical in deciding memory leakage. What they show is how many objects are there in the Heap. If there are 10 String Objects in the heap after 1 min. of program start and 50 Objects after 2 min. (after invoking GC), this could be due to the normal activity of the program and not memory leakage.
    Pls remember any response to this thread would be beneficial to lot many Java guys I know with even 6-9 yrs. experience would want to know. So Instead of giving links to any site, I would appreciate if anyone can explain this in some simple language.
    Thanks,
    AA

    You don't have to launch Instruments from Xcode. To get started detecting memory leaks with Instruments, launch Instruments. A sheet will open asking you to choose a template. Select Leaks and click the Choose button.
    In the lower left corner of the trace window are three buttons. Click the right one. Doing so will open the detail view, which will let you configure how Instruments detects the leaks. Instruments is initially set to auto-detect leaks, and it checks every 10 seconds. This setup could be the cause of your problem where Instruments doesn't find any leaks. Your small test program may be finishing before Instruments detects the leak.
    After you get the trace configured, go to the Default Target pop-up menu in the trace window toolbar. Choose Launch Executable > Choose Executable. Select your app and click the Record button to start tracing.
    If Instruments doesn't work for you, there are alternatives for Mac applications. MallocDebug can detect memory leaks, and it's installed with the Xcode Tools. leaks is a command-line application that detects memory leaks. Valgrind is available for Mac OS X, and it detects memory leaks.

  • Are there any good tool for checking security risks, Code review, memory leakages for SharePoint projects?

    Are there any good tool for checking security risks, Code review, memory leakages for SharePoint projects?
    I found one such tool "Fortify" in the below link. Are there any such kind of tools available which supports SharePoint?
    Reference: http://www.securityresearch.at/en/development/fortify/
    Amalaraja Fernando,
    SharePoint Architect
    Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. This post is provided "AS IS" with no warrenties and confers no rights.

    Hi Amalaraja Fernando,
    I'm not sure that there is one more tool that combines all these features. But you may take a look at these solutions:
    SharePoint diagnostic manager
    SharePoint enterprise manager
    What is SPCop SharePoint Code Analysis?
    Dmitry
    Lightning Tools Check
    out our SharePoint tools and web parts |
    Lightning Tools Blog | Мой Блог

  • Memory Leakage in dlls called through JNI

    I have some dll that are called through a JNI code that have a memory leakage. I need to find how much is that.
    Do we have some functions for that to find it in the code.Is that possible without making changes in the JNI code.
    I checked but all suggest a memory leakage tool.But i want to do that writing a code in Java.I have checked for the Runtime class but it only finds the JVM related memory usage and not the dll one.

    amol28 wrote:
    But i want to do that writing a code in Java.Not possible. JNI/C/C++ is not java. So you can't use java to verify it.
    I checked but all suggest a memory leakage toolEither that or you manually inspect and/or test the code yourself (in C/C++).

  • Does making objects equal null help the gc handle memory leakage problems

    hi all,
    does making objects equal null help the gc handle memory leakage problems ?
    does that help out the gc to collect unwanted objects ??
    and how can I free memory avoid memory leakage problems on devices ??
    best regards,
    Message was edited by:
    happy_life

    Comments inlined:
    does making objects equal null help the gc handle
    memory leakage problems ?To an extent yes. During the mark phase it will be easier for the GC to identify the nullified objects on the heap while doing reference analysis.
    does that help out the gc to collect unwanted objects
    ??Same answer as earlier, Eventhough you nullify the object you cannot eliminate the reference analysis phase of GC which definitelely would take some time.
    and how can I free memory avoid memory leakage
    problems on devices ??There is nothing like soft/weak reference stuffs that you get in J2SE as far as J2ME is concerned with. Also, user is not allowed to control GC behavior. Even if you use System.gc() call you are never sure when it would trigger the GC thread. Kindly as far as possible do not create new object instances or try to reuse the instantiated objects.
    ~Mohan

Maybe you are looking for

  • Error 500: ERROR: Cannot forward. Writer or Stream already obtained. Error

    hi i m unable to fugure out y I m getting this error it's a suggestion page and on submitting this page I have to reload the page but with status of the page (requires approval) in form of url earlier say few days back , it was working fine , i had a

  • Backwards compatibility of .psd files with spot channels

    Over the years Adobe Photoshop has done a really excellent job of keeping image files backwards compatible.  Unfortunately it is still possible to save files may not be opened by previous versions of the software.  This happens when a spot color is s

  • Subscription Issue - 3 months calling to India 120...

    I have subscribed for 3 months plan on 28 th Mar 2015. But it did not add calling minutes for may'15. Can I know why i did not get calling minutes for May?

  • STUN: AS400 to FEP SDLC

    I am having issues in brining up the connectivity between AS400 connecting to FEP using SDLC. I am trying to perform STUN SDLC on the 2800 routers with low speed WAN interfaces facing AS400 and FEP, here is the toplogy; as400----R1-------R2-------FEP

  • Can't mount NTFS drives on 10.5.8

    I was given a 1TB WD external drive today that won't mount on my MBP. When I plug it in, I get a window that says, "The disk you inserted could not be read by this computer." Under Disk Utility, I can see the drive icon and gather the info under "For