We are seeing FD leak in our application while using Oracle DB. FD leaks are happening for files ocius.msb. We dont see the FD leaks while using with simple stand alone application.

debug.pl 8588 root 48r REG 253,0 27648 1325248 oracle/rdbms/mesg/ocius.msb

debug.pl 8588 root 49r REG 253,0 27648 1325248 oracle/rdbms/mesg/ocius.msb

debug.pl 8588 root 50r REG 253,0 27648 1325248 oracle/rdbms/mesg/ocius.msb

debug.pl 8588 root 51r REG 253,0 27648 1325248 oracle/rdbms/mesg/ocius.msb

Perl Vesrion: 5.10.x DBD : 1.80 DBI : 1.643

Stand alone application code where leak is not seen

#!/use/bin/perl use strict ; use DBI; my $count = 0; sub showtime () { print "Starting loop \n"; while ( $count < 50 ) { $count++; print "Inside loop \n"; my $dbh = DBI->connect("DBI:Oracle:host=localhost;port=1521;sid=syn +o",'xyx','xyx',{PrintError => 1, RaiseError => 1, ora_envhp => 0}); my $cmd = "grep VmRSS /proc/$$/status"; print`$cmd`; sleep(1); $dbh->disconnect or warn "Disconnection failed: $DBI::errstr\n"; } print "Ending script \n"; } showtime

Our application opens a DEBUG file to capture DB errro/warnings. content of the DB file is displayed below.

Start debug file DBI 1.643-ithread default trace level set to 0x0/4 (pid 2349 pi 7f +c7300692a0) at access_database.pm line 280 via (eval 18) line 10 -> DBI->connect(dbi:Oracle:temip_syno_ip_read, temipsyno, ****, HA +SH(0x7fc7307d4158)) -> DBI->install_driver(Oracle) for linux perl=5.010001 pid=2349 ru +id=514 euid=514 install_driver: DBD::Oracle version 1.80 loaded from /usr/opt/t +emip/alarm_beautifier/perl/lib/site_perl/5.10.1/x86_64-linux-thread-m +ulti/DBD/Oracle.pm -> STORE in DBD::_::common for DBD::Oracle::dr (DBI::dr=HASH(0x7fc +7307f7270)~0x7fc7307f71c8 'ShowErrorStatement' 1) thr#7fc7300692a0 STORE DBI::dr=HASH(0x7fc7307f71c8) 'ShowErrorStatement' => 1 <- STORE= 1 at /usr/opt/temip/alarm_beautifier/perl/lib/site_perl/ +5.10.1/x86_64-linux-thread-multi/DBD/Oracle.pm line 77 via at (eval +18) line 10 <- install_driver= DBI::dr=HASH(0x7fc7307f7270) -> connect for DBD::Oracle::dr (DBI::dr=HASH(0x7fc7307f7270)~0x7fc +7307f71c8 'temip_syno_ip_read' 'temipsyno' **** HASH(0x7fc73051d478)) + thr#7fc7300692a0 charset id=1, name=US7ASCII, ncharset id=1, name=US7ASCII ( +csid: utf8=0 al32utf8=0) <- connect= DBI::db=HASH(0x7fc73088dee8) at /usr/opt/temip/alarm_b +eautifier/perl/lib/site_perl/5.10.1/x86_64-linux-thread-multi/DBI.pm +line 679 via at (eval 18) line 10 -> STORE for DBD::Oracle::db (DBI::db=HASH(0x7fc73088ddf8)~INNER ' +RaiseError' 1) thr#7fc7300692a0 STORE DBI::db=HASH(0x7fc73088ddf8) 'RaiseError' => 1 <- STORE= 1 at /usr/opt/temip/alarm_beautifier/perl/lib/site_perl/ +5.10.1/x86_64-linux-thread-multi/DBI.pm line 731 via at (eval 18) li +ne 10 -> STORE for DBD::Oracle::db (DBI::db=HASH(0x7fc73088ddf8)~INNER ' +PrintError' 1) thr#7fc7300692a0 STORE DBI::db=HASH(0x7fc73088ddf8) 'PrintError' => 1 <- STORE= 1 at /usr/opt/temip/alarm_beautifier/perl/lib/site_perl/ +5.10.1/x86_64-linux-thread-multi/DBI.pm line 731 via at (eval 18) li +ne 10 -> STORE for DBD::Oracle::db (DBI::db=HASH(0x7fc73088ddf8)~INNER ' +AutoCommit' 1) thr#7fc7300692a0 <- STORE= 1 at /usr/opt/temip/alarm_beautifier/perl/lib/site_perl/ +5.10.1/x86_64-linux-thread-multi/DBI.pm line 731 via at (eval 18) li +ne 10 -> STORE for DBD::Oracle::db (DBI::db=HASH(0x7fc73088ddf8)~INNER ' +Username' 'temipsyno') thr#7fc7300692a0 STORE DBI::db=HASH(0x7fc73088ddf8) 'Username' => 'temipsyno' <- STORE= 1 at /usr/opt/temip/alarm_beautifier/perl/lib/site_perl/ +5.10.1/x86_64-linux-thread-multi/DBI.pm line 734 via at /usr/opt/tem +ip/alarm_beautifier/bin//access_database.pm line 354 -> connected in DBD::_::db for DBD::Oracle::db (DBI::db=HASH(0x7fc +73088dee8)~0x7fc73088ddf8 'dbi:Oracle:temip_syno_ip_read' 'temipsyno' + **** HASH(0x7fc7307d4158)) thr#7fc7300692a0 <- connected= undef at /usr/opt/temip/alarm_beautifier/perl/lib/si +te_perl/5.10.1/x86_64-linux-thread-multi/DBI.pm line 741 via at (eva +l 18) line 10 <- connect= DBI::db=HASH(0x7fc73088dee8) -> STORE for DBD::Oracle::db (DBI::db=HASH(0x7fc73088ddf8)~INNER ' +dbi_connect_closure' CODE(0x7fc73088a900)) thr#7fc7300692a0 STORE DBI::db=HASH(0x7fc73088ddf8) 'dbi_connect_closure' => CODE(0 +x7fc73088a900) <- STORE= 1 at /usr/opt/temip/alarm_beautifier/perl/lib/site_perl/ +5.10.1/x86_64-linux-thread-multi/DBI.pm line 750 via at /usr/opt/tem +ip/alarm_beautifier/bin//access_database.pm line 354 -> STORE for DBD::Oracle::db (DBI::db=HASH(0x7fc73088ddf8)~INNER ' +LongReadLen' 128) thr#7fc7300692a0 STORE DBI::db=HASH(0x7fc73088ddf8) 'LongReadLen' => 128 <- STORE= 1 at /usr/opt/temip/alarm_beautifier/bin//access_databas +e.pm line 390 via at (eval 18) line 10 -> STORE for DBD::Oracle::db (DBI::db=HASH(0x7fc73088ddf8)~INNER ' +LongTruncOk' 1) thr#7fc7300692a0 STORE DBI::db=HASH(0x7fc73088ddf8) 'LongTruncOk' => 1 <- STORE= 1 at access_database.pm line 391 via at (eval 18) line +10 -> prepare for DBD::Oracle::db (DBI::db=HASH(0x7fc73088dee8)~0x7fc +73088ddf8 'select spec, ipaddr0 from ip where rownum = '1'') thr#7f +c7300692a0 dbd_st_prepare'd sql SELECT ( auto_lob1, check_sql1) dbd_describe SELECT (EXPLICIT, lb 128)... Describe col #1 type=1(VARCHAR) Described col 1: dbtype 1(VARCHAR), scale 0, prec 2048, nullok 0, nam +e ENTITY_SPEC : dbsize 2048, char_used 0, char_size 2048, csid 1, +csform 1(SQLCS_IMPLICIT), disize 2048 fbh 1: 'ENTITY_SPEC' NO null , otype 1-> 5, dbsize 2048/ +2049, p2048.s0 Describe col #2 type=2(NVARCHAR2) Described col 2: dbtype 2(NVARCHAR2), scale 0, prec 3, nullok 1, name + IPADDR0 : dbsize 22, char_used 0, char_size 0, csid 0, csfor +m 0(0), disize 171 fbh 2: 'IPADDR0' NULLable, otype 2-> 5, dbsize 22/17 +2, p3.s0 cache settings DB Handle RowCacheSize=0,Statement Handle RowCa +cheSize=0, OCI_ATTR_PREFETCH_ROWS=60, OCI_ATTR_PREFETCH_MEMORY=0, Row +s per Fetch=60, Multiple Row Fetch=On calling OCIAttrSet OCI_ATTR_CHARSET_FORM with csform=1 (SQLCS_ +IMPLICIT) dbd_describe'd 2 columns (row bytes: 2070 max, 1028 est avg, c +ache: 0) <- prepare= DBI::st=HASH(0x7fc7307f6a90) at access_database.pm lin +e 453 via at access_database.pm line 423 -> $DBI::err (*) FETCH from lasth=HASH <- $DBI::err= undef -> execute for DBD::Oracle::st (DBI::st=HASH(0x7fc7307f6a90)~0x7fc +7307f6c70) thr#7fc7300692a0 dbd_st_execute SELECT (out0, lob0)... Statement Execute Mode is 0 (DEFAULT) rs_array_init:imp_sth->rs_array_size=60, rs_array_idx=0, prefe +tch_rows=0, rs_array_status=SUCCESS dbd_st_execute SELECT returned (SUCCESS, rpc0, fn4, out0) <- execute= '0E0' at access_database.pm line 470 via at access_da +tabase.pm line 467 -> $DBI::err (*) FETCH from lasth=HASH <- $DBI::err= undef -> fetchrow_array for DBD::Oracle::st (DBI::st=HASH(0x7fc7307f6a90 +)~0x7fc7307f6c70) thr#7fc7300692a0 dbd_st_fetch 2 fields... ...Fetched 1 rows dbd_st_fetched 2 fields with status of 0(SUCCESS) field #1 with rc=0(OK) field #2 with rc=0(OK) <- fetchrow_array= ( 'OSI_SYSTEM ossvm42_ns:.sanity_osi1' '10' ) [ +2 items] row1 at access_database.pm line 492 via at access_database. +pm line 423 -> fetchrow_array for DBD::Oracle::st (DBI::st=HASH(0x7fc7307f6a90 +)~0x7fc7307f6c70) thr#7fc7300692a0 dbd_st_fetch 2 fields... dbd_st_fetch no-more-data, fetch count=0 <- fetchrow_array= ( ) [0 items] row1 at access_database.pm line 4 +99 via at access_database.pm line 423 <> DESTROY(DBI::st=HASH(0x7fc7307f6a90)) ignored for outer handle +(inner DBI::st=HASH(0x7fc7307f6c70) has ref cnt 1) -> DESTROY for DBD::Oracle::st (DBI::st=HASH(0x7fc7307f6c70)~INNER +) thr#7fc7300692a0 <- DESTROY= undef at access_database.pm line 423 via at access_da +tabase.pm line 423 dbih_clearcom 0x7fc7307f6c70 (com 0x7fc73091cff0, type 3) done.

In reply to FD leaks while interacting with DB by prabakar.bhatt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.