{"id":2031,"date":"2015-09-03T15:33:27","date_gmt":"2015-09-03T13:33:27","guid":{"rendered":"http:\/\/www.oradba.ch\/?p=2031"},"modified":"2015-09-04T07:06:52","modified_gmt":"2015-09-04T05:06:52","slug":"memory-leak-in-network-checksum-with-new-sha-2-functions","status":"publish","type":"post","link":"https:\/\/www.oradba.ch\/wordpress\/2015\/09\/memory-leak-in-network-checksum-with-new-sha-2-functions\/","title":{"rendered":"Memory Leak in Network Checksum with new SHA-2 Functions"},"content":{"rendered":"<p>I&#8217;ve just stumbled over an issue with the new checksum algorithm introduced with Oracle 12c. It seams that in certain situation the new SHA-2 function cause a memory leak. A search on My Oracle Support revealed that there is a Bug on AIX. See Bug <a href=\"https:\/\/support.oracle.com\/epmos\/faces\/BugDisplay?id=19451972\">19451972<\/a> <em>MEMEORY LEAKS WITH SHA512, SHA384, SHA256 ENTRIES IN SQLNET.CRYPTO_CHECKSUM<\/em> and the corresponding Note <a href=\"https:\/\/support.oracle.com\/epmos\/faces\/DocumentDisplay?id=1919000.1\">1919000.1<\/a> <em>SQLPlus 12c Memory usage Grows (Leaks) While Running Long Query<\/em>.<\/p>\n<h2>Test Case<\/h2>\n<p>Nevertheless I have similar issues on a Exadata Machine and my Oracle VM. To verify my issue I&#8217;ve used a simple test case, where I start a SQL*Plus script which does:<\/p>\n<ol>\n<li>connect as SCOTT<\/li>\n<li>query some views eg. v$session_connect_info<\/li>\n<li>wait a few seconds<\/li>\n<li>query some views eg. v$session_connect_info<\/li>\n<li>start over with step 1<\/li>\n<\/ol>\n<p>Since SQL*Plus does not support any loop I just use <code class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">cat<\/code> to generate a script with a bunch of connect and <code class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">SELECT<\/code>. For this I used the following Template (<code class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">connect_scott_template.sql<\/code>):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\">\r\nconnect scott\/tiger@TDB12A\r\nalter session set nls_date_format=&#039;DD.MM.YYYY HH24:MI:SS&#039;;\r\nselect sysdate from dual;\r\nselect sid, osuser, authentication_type, network_service_banner\r\nfrom v$session_connect_info\r\nwhere sid=(select sys_context(&#039;userenv&#039;,&#039;sid&#039;) from dual);\r\nexec DBMS_LOCK.SLEEP(10);\r\n<\/pre>\n<p>Based on this template I&#8217;ve created my SQL script with a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">for<\/code> loop.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">for i in {1..720}; do cat connect_scott_template.sql &gt;&gt;connect_scott.sql ; done<\/pre>\n<p>If the script runs for a couple of minutes \/ hour you will see that RSS (real memory size \/ resident set size) does increase when network integrity check is enabled with SHA512. It remains on the same level for the same test without network integrity check. Below you see the output of my bash session history (with minor optimization for the web \ud83d\ude09 ):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">\r\ncd \/u00\/app\/oracle\/admin\/TDB12A\/adhoc\/nocksum\r\nexport TNS_ADMIN=$PWD\r\n\r\nnohup sqlplus \/nolog @connect_scott.sql &amp;\r\n\r\nPID=17185\r\n\r\nwhile [[ $(ps $PID|wc -l) &gt; 1 ]]\r\ndo \r\necho $(date &quot;+%Y.%m.%d %H:%M:%S $(ps u $PID|tail -1)&quot;) &gt;&gt;connect_scott_nocksum_&lt;code&gt;{{EJS0}}&lt;\/code&gt;.log\r\nsleep 30\r\ndone\r\n<\/pre>\n<p>I&#8217;ve started sqlplus and the script with nohup. To collect the rss information I&#8217;ve just created a while loop and pipe the output of <code class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">ps<\/code> to a log file. For the test with checksum typ SHA512 used an alternative TNS_ADMIN directory with a different <code class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\">sqlnet.ora<\/code>. My Test did run for about two hours. I&#8217;ve but the collected data in an Excel sheet to create the following chart. You see, that both SQL*Plus process require more real memory over time. Nevertheless the required memory for SQL*Plus with SHA512 is definitely higher.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/MemoryLeak.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/MemoryLeak.png?resize=300%2C180&#038;ssl=1\" alt=\"MemoryLeak\" width=\"300\" height=\"180\" class=\"aligncenter size-medium wp-image-2033\" srcset=\"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/MemoryLeak.png?resize=300%2C180&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/MemoryLeak.png?resize=1024%2C613&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/MemoryLeak.png?resize=624%2C374&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/MemoryLeak.png?w=1800&amp;ssl=1 1800w, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/MemoryLeak.png?w=1250&amp;ssl=1 1250w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>Files and References<\/h2>\n<p>Below you find the scripts mentioned above as well some MOS references:<\/p>\n<ul>\n<li>SQLPlus 12c Memory usage Grows (Leaks) While Running Long Query [<em><a href=\"https:\/\/support.oracle.com\/epmos\/faces\/DocumentDisplay?id=1919000.1\">1919000.1<\/a><\/em>]<\/li>\n<li>MEMEORY LEAKS WITH SHA512, SHA384, SHA256 ENTRIES IN SQLNET.CRYPTO_CHECKSUM [<em><a href=\"https:\/\/support.oracle.com\/epmos\/faces\/BugDisplay?id=19451972\">19451972<\/a><\/em>]<\/li>\n<li><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/plugins\/wp-downloadmanager\/images\/ext\/unknown.gif?w=625&#038;ssl=1\" alt=\"\" title=\"\" style=\"vertical-align: middle;\" \/>&nbsp;<a href=\"https:\/\/www.oradba.ch\/wordpress\/download\/AnalysisMemoryLeak.xlsx\">MemoryLeak.xlsx<\/a><\/li>\n<li><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/plugins\/wp-downloadmanager\/images\/ext\/unknown.gif?w=625&#038;ssl=1\" alt=\"\" title=\"\" style=\"vertical-align: middle;\" \/>&nbsp;<a href=\"https:\/\/www.oradba.ch\/wordpress\/download\/connect_scott_template.sql\">connect_scott_template.sql<\/a><\/li>\n<li><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/plugins\/wp-downloadmanager\/images\/ext\/unknown.gif?w=625&#038;ssl=1\" alt=\"\" title=\"\" style=\"vertical-align: middle;\" \/>&nbsp;<a href=\"https:\/\/www.oradba.ch\/wordpress\/download\/connect_scott.sql\">connect_scott.sql<\/a><\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>It seems that this Bug is a bit more generic than expected. Since the new SHA function would anyway just work for pure 12c environment, it is acceptable to use the old SHA1 Hash until this Bug is fixed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve just stumbled over an issue with the new checksum algorithm introduced with Oracle 12c. It seams that in certain situation the new SHA-2 function cause a memory leak. A search on My Oracle Support revealed that there is a Bug on AIX. See Bug 19451972 MEMEORY LEAKS WITH SHA512, SHA384, SHA256 ENTRIES IN SQLNET.CRYPTO_CHECKSUM [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Memory Leak in Network Checksum with new SHA-2 Functions #trivadis","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[83,101,11],"tags":[111],"class_list":["post-2031","post","type-post","status-publish","format-standard","hentry","category-12cr1","category-bug","category-security","tag-tvdsecexpert"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1aErb-wL","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2053,"url":"https:\/\/www.oradba.ch\/wordpress\/2015\/10\/wallet_location-in-sqlnet-ora-for-container-databases\/","url_meta":{"origin":2031,"position":0},"title":"WALLET_LOCATION in sqlnet.ora for Container Databases","author":"Stefan","date":"31. October 2015","format":false,"excerpt":"Recently I've setup Oracle Enterprise User Security (EUS) with Oracle Unified Directory (OUD) on my favorite linux test system. Among regular 11.2.0.4 and 12.1.0.2 databases I do also have a 12.1.0.2 Container Database. EUS work like a charm on the regular databases but not on the PDB. [cc lang=\"sql\"] SQL>\u2026","rel":"","context":"In &quot;12cR1&quot;","block_context":{"text":"12cR1","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/12cr1\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1389,"url":"https:\/\/www.oradba.ch\/wordpress\/2013\/08\/oracle-database-12c-new-feature-last-login-time\/","url_meta":{"origin":2031,"position":1},"title":"Oracle Database 12c New Feature: Last Login Time","author":"Stefan","date":"22. August 2013","format":false,"excerpt":"As Markus Flechtner has already mentioned in his blog, Oracle has started to record the last login time. It is a small but very useful 12c security feature and operates independently of the database audit. Nevertheless, there are some restrictions. But let's start at the beginning\u2026 A simple example Ok,\u2026","rel":"","context":"In &quot;12cR1&quot;","block_context":{"text":"12cR1","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/12cr1\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1201,"url":"https:\/\/www.oradba.ch\/wordpress\/2013\/06\/oracle-12c-new-security-features\/","url_meta":{"origin":2031,"position":2},"title":"Oracle 12c New Security Features","author":"Stefan","date":"26. June 2013","format":false,"excerpt":"I've just uploaded the slides for my lecture Oracle 12c new security features, as I had promised this in my previous posts. (See also DOAG 2013 Datenbank or DOAG SIG Security). The slides is a consolidation of my presentations on the New Security Features in latest generation of Oracle Database\u2026","rel":"","context":"In &quot;12cR1&quot;","block_context":{"text":"12cR1","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/12cr1\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7846,"url":"https:\/\/www.oradba.ch\/wordpress\/2020\/12\/security-best-practice-oracle-passwords-but-secure\/","url_meta":{"origin":2031,"position":3},"title":"Security Best Practice: Oracle passwords, but secure!","author":"Stefan","date":"1. December 2020","format":false,"excerpt":"Beach view in Brighton at the UKOUG Techfest 2019 Today I held my presentation about Oracle security best practice \"Oracle passwords, but secure!\u201d at the virtual UKOUG event. Unfortunately, this year the beautiful view of Brighton beach and the active exchange with colleagues was missing. Ok, on the other hand\u2026","rel":"","context":"In &quot;12R2&quot;","block_context":{"text":"12R2","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/12r2\/"},"img":{"alt_text":"Beach view in Brighton at the UKOUG Techfest 2019","src":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1851,"url":"https:\/\/www.oradba.ch\/wordpress\/2014\/07\/oracle-12-1-0-2-0-patchset-released\/","url_meta":{"origin":2031,"position":4},"title":"Oracle 12.1.0.2.0 Patchset released","author":"Stefan","date":"23. July 2014","format":false,"excerpt":"About a week ago Oracle has released the first patchset 12.1.0.2.0 for Oracle 12c Release 1. So far the patch set is only available for Linux x86-64bit, Oracle Solaris SPARC 64bit and Oracle Solaris x86-64bit. You may download the Patchset on Oracle Software Delivery Cloud eDelivery.oracle.com, on Oracle Technology Network\u2026","rel":"","context":"In &quot;12cR1&quot;","block_context":{"text":"12cR1","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/12cr1\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3087,"url":"https:\/\/www.oradba.ch\/wordpress\/2019\/06\/pdb_os_credential-with-external-table-pre-processor\/","url_meta":{"origin":2031,"position":5},"title":"PDB_OS_CREDENTIAL with external table pre-processor","author":"Stefan","date":"17. June 2019","format":false,"excerpt":"As part of a customer project I am currently enhancing PDB security and isolation. Since OS interaction is necessary, I can not just use lockdown profile to block OS access. The idea is to isolate the PDB with lockdown profiles and allow dedicated OS access. The idea is to isolate\u2026","rel":"","context":"In &quot;12cR2&quot;","block_context":{"text":"12cR2","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/12cr2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/2031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/comments?post=2031"}],"version-history":[{"count":4,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/2031\/revisions"}],"predecessor-version":[{"id":2036,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/2031\/revisions\/2036"}],"wp:attachment":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/media?parent=2031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/categories?post=2031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/tags?post=2031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}