<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Halting due to Out Of Memory Error...Exit code 255 - hive - tez - java heap - GC in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Halting-due-to-Out-Of-Memory-Error-Exit-code-255-hive-tez/m-p/324187#M229305</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map1.PNG" style="width: 780px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/32262i54A6CB0119E87C8D/image-size/large?v=v2&amp;amp;px=999" role="button" title="map1.PNG" alt="map1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can some one please help me fix this OOM error||heap issue , while running query from hive&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "client DomainSocketWatcher"&lt;/P&gt;&lt;P&gt;-----------&lt;/P&gt;&lt;P&gt;Map1 - stays in initializing state and not moving to running state with OOM error&lt;/P&gt;&lt;P&gt;ERROR:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Application application_1616507270167_1067 failed 2 times due to AM Container for appattempt_1616507270167_1067_000002 exited with&amp;nbsp; exitCode: 255&lt;/P&gt;&lt;P&gt;Failing this attempt.Diagnostics: [2021-09-07 09:49:05.213]Exception from container-launch.&lt;/P&gt;&lt;P&gt;Container exited with a non-zero exit code 255. Error file: prelaunch.err.&lt;/P&gt;&lt;P&gt;Exit code: 255&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;java.sql.SQLExceptionPyRaisable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Traceback (most recent call last)&lt;/P&gt;&lt;P&gt;/opt/conda/lib/python3.6/site-packages/jaydebeapi/__init__.py in execute(self, operation, parameters)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;/P&gt;&lt;P&gt;--&amp;gt; 501&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is_rs = self._prep.execute()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 502&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:&lt;/P&gt;&lt;P&gt;--------------------------&lt;/P&gt;&lt;P&gt;--------&lt;/P&gt;&lt;P&gt;[Eden: 0.0B(163.0M)-&amp;gt;0.0B(163.0M) Survivors: 0.0B-&amp;gt;0.0B Heap: 3275.3M(3276.0M)-&amp;gt;3275.3M(3276.0M)]&lt;BR /&gt;[Times: user=0.01 sys=0.00, real=0.00 secs]&lt;/P&gt;&lt;P&gt;326.881: [Full GC (Allocation Failure)&lt;/P&gt;&lt;P&gt;--------------------&lt;/P&gt;&lt;P&gt;exec /bin/bash -c "$JAVA_HOME/bin/java -Xmx3276m -Djava.io.tmpdir=$PWD/tmp -server&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;config&lt;/P&gt;&lt;P&gt;-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseG1GC -XX:+ResizeTLAB{{heap_dump_opts}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hive - used for querying&lt;BR /&gt;Tez - application type&lt;/P&gt;&lt;P&gt;Yarn - scheduler&lt;/P&gt;</description>
    <pubDate>Sun, 12 Sep 2021 14:45:45 GMT</pubDate>
    <dc:creator>manojamr</dc:creator>
    <dc:date>2021-09-12T14:45:45Z</dc:date>
    <item>
      <title>Halting due to Out Of Memory Error...Exit code 255 - hive - tez - java heap - GC</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Halting-due-to-Out-Of-Memory-Error-Exit-code-255-hive-tez/m-p/324187#M229305</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="map1.PNG" style="width: 780px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/32262i54A6CB0119E87C8D/image-size/large?v=v2&amp;amp;px=999" role="button" title="map1.PNG" alt="map1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can some one please help me fix this OOM error||heap issue , while running query from hive&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "client DomainSocketWatcher"&lt;/P&gt;&lt;P&gt;-----------&lt;/P&gt;&lt;P&gt;Map1 - stays in initializing state and not moving to running state with OOM error&lt;/P&gt;&lt;P&gt;ERROR:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Application application_1616507270167_1067 failed 2 times due to AM Container for appattempt_1616507270167_1067_000002 exited with&amp;nbsp; exitCode: 255&lt;/P&gt;&lt;P&gt;Failing this attempt.Diagnostics: [2021-09-07 09:49:05.213]Exception from container-launch.&lt;/P&gt;&lt;P&gt;Container exited with a non-zero exit code 255. Error file: prelaunch.err.&lt;/P&gt;&lt;P&gt;Exit code: 255&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;java.sql.SQLExceptionPyRaisable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Traceback (most recent call last)&lt;/P&gt;&lt;P&gt;/opt/conda/lib/python3.6/site-packages/jaydebeapi/__init__.py in execute(self, operation, parameters)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;/P&gt;&lt;P&gt;--&amp;gt; 501&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is_rs = self._prep.execute()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 502&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:&lt;/P&gt;&lt;P&gt;--------------------------&lt;/P&gt;&lt;P&gt;--------&lt;/P&gt;&lt;P&gt;[Eden: 0.0B(163.0M)-&amp;gt;0.0B(163.0M) Survivors: 0.0B-&amp;gt;0.0B Heap: 3275.3M(3276.0M)-&amp;gt;3275.3M(3276.0M)]&lt;BR /&gt;[Times: user=0.01 sys=0.00, real=0.00 secs]&lt;/P&gt;&lt;P&gt;326.881: [Full GC (Allocation Failure)&lt;/P&gt;&lt;P&gt;--------------------&lt;/P&gt;&lt;P&gt;exec /bin/bash -c "$JAVA_HOME/bin/java -Xmx3276m -Djava.io.tmpdir=$PWD/tmp -server&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;config&lt;/P&gt;&lt;P&gt;-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseG1GC -XX:+ResizeTLAB{{heap_dump_opts}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hive - used for querying&lt;BR /&gt;Tez - application type&lt;/P&gt;&lt;P&gt;Yarn - scheduler&lt;/P&gt;</description>
      <pubDate>Sun, 12 Sep 2021 14:45:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Halting-due-to-Out-Of-Memory-Error-Exit-code-255-hive-tez/m-p/324187#M229305</guid>
      <dc:creator>manojamr</dc:creator>
      <dc:date>2021-09-12T14:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Halting due to Out Of Memory Error...Exit code 255 - hive - tez - java heap - GC</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Halting-due-to-Out-Of-Memory-Error-Exit-code-255-hive-tez/m-p/324321#M229336</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/91803"&gt;@manojamr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 1: Could you run the following commands to gather column statistics for all the table that is involved in the query.&lt;/P&gt;&lt;P&gt;analyze table &amp;lt;TABLE-NAME&amp;gt; compute statistics;&lt;BR /&gt;analyze table &amp;lt;TABLE-NAME&amp;gt; compute statistics for columns;&lt;/P&gt;&lt;P&gt;Reference: &lt;A href="https://cwiki.apache.org/confluence/display/Hive/StatsDev" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/StatsDev&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 2: set the following property in session level&lt;BR /&gt;set hive.tez.container.size=10240 ;&lt;BR /&gt;set hive.tez.java.opts=-Xmx8192m;&lt;BR /&gt;set tez.runtime.io.sort.mb=4096;&lt;BR /&gt;set tez.task.resource.memory.mb=7680;&lt;BR /&gt;set tez.am.resource.memory.mb=10240;&lt;BR /&gt;set tez.am.launch.cmd-opts=-Xmx8192m;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Step2 got succes ignore step 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 3:&lt;BR /&gt;Re-run the job at the beeline session-level.&lt;/P&gt;&lt;P&gt;If the job fails again, I would request the below details.&lt;/P&gt;&lt;P&gt;1. Complete query,&lt;BR /&gt;2. Beeline console output,&lt;BR /&gt;3. QueryId of the job&lt;BR /&gt;4. HS2 and HMS logs and&lt;BR /&gt;5. Application logs.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 11:21:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Halting-due-to-Out-Of-Memory-Error-Exit-code-255-hive-tez/m-p/324321#M229336</guid>
      <dc:creator>Shifu</dc:creator>
      <dc:date>2021-09-14T11:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Halting due to Out Of Memory Error...Exit code 255 - hive - tez - java heap - GC</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Halting-due-to-Out-Of-Memory-Error-Exit-code-255-hive-tez/m-p/324458#M229373</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/76164"&gt;@Shifu&lt;/a&gt;&amp;nbsp; - Thanks for the inputs&lt;BR /&gt;&lt;BR /&gt;Finally by modifying these parameters job started running&lt;BR /&gt;set tez.am.java.opts=-Xmx14745m;&lt;BR /&gt;set tez.am.resource.memory.mb=16384;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However this hive-tez job is taking almost 9.5 hours to get the query executed completely .&lt;BR /&gt;Total number of records in the table approx (1.2 billion) - 1137722667&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the query used . If you have any suggestion which could improve the query execution time&lt;/P&gt;&lt;P&gt;that would be great&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select station_id, parameter_name, unit_name, statistic_name, latitude, longitude, from_unixtime(UNIX_TIMESTAMP(observed_date, "yyyy-MM-dd'T'HH:mm:ss'Z'"),"yyyy-MM-dd") as observed_date, avg(value) as value from today_data.price where parameter_name= 'AIR_TEMPERATURE' and unit_name = 'DEGREES_CELSIUS' and statistic_name='MEAN' and year(from_unixtime(UNIX_TIMESTAMP(observed_date, "yyyy-MM-dd'T'HH:mm:ss'Z'"),"yyyy-MM-dd HH:mm:ss")) = 2021 group by station_id, parameter_name, unit_name, statistic_name, latitude, longitude, from_unixtime(UNIX_TIMESTAMP(observed_date, "yyyy-MM-dd'T'HH:mm:ss'Z'"),"yyyy-MM-dd");&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 23:57:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Halting-due-to-Out-Of-Memory-Error-Exit-code-255-hive-tez/m-p/324458#M229373</guid>
      <dc:creator>manojamr</dc:creator>
      <dc:date>2021-09-15T23:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Halting due to Out Of Memory Error...Exit code 255 - hive - tez - java heap - GC</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Halting-due-to-Out-Of-Memory-Error-Exit-code-255-hive-tez/m-p/324643#M229427</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/91803"&gt;@manojamr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am glad to know your original issue got resolved.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As per your last comment, your Query took 9.5 hours to get complete.&lt;BR /&gt;In this case, we may need to check whether there is a delay or hungriness, or resource crunch or it is normal.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;To figure out that we may need beeline console output, QueryId, Application log, all HS2 and HMS logs. It would be great if you create a case with Cloudera so we would be happy to assist you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are happy with the reply, mark it Accept as Solution&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:56:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Halting-due-to-Out-Of-Memory-Error-Exit-code-255-hive-tez/m-p/324643#M229427</guid>
      <dc:creator>Shifu</dc:creator>
      <dc:date>2021-09-17T13:56:45Z</dc:date>
    </item>
  </channel>
</rss>

