<?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 Re: Out of Memory issue while executing simple Hive Query: java.lang.OutOfMemoryError: Java heap space in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Out-of-Memory-issue-while-executing-simple-Hive-Query-java/m-p/334436#M231763</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could you pleases tell me how to reducing container size. But, I executed query successfully but sometimes it got fails. please suggest it is very urgent issue going on.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jan 2022 10:48:25 GMT</pubDate>
    <dc:creator>lav</dc:creator>
    <dc:date>2022-01-24T10:48:25Z</dc:date>
    <item>
      <title>Out of Memory issue while executing simple Hive Query: java.lang.OutOfMemoryError: Java heap space</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Out-of-Memory-issue-while-executing-simple-Hive-Query-java/m-p/241697#M203500</link>
      <description>&lt;P&gt;&lt;B&gt;Hive
Table:&lt;/B&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Internal table&lt;/LI&gt;&lt;LI&gt;ROW FORMAT SERDE
'org.apache.hive.hcatalog.data.JsonSerDe' STORED AS TEXTFILE&lt;/LI&gt;&lt;LI&gt;Data ingestion is successful&lt;/LI&gt;&lt;LI&gt;Facing memory issues while querying!&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Input file&lt;/STRONG&gt;: JSON file&lt;/P&gt;&lt;P&gt;While researching
on memory configuration, found some information &lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.4/bk_installing_manually_book/content/determine-hdp-memory-config.html#ref-cb07873e-edba-4c77-bd34-edbcefcbfc16" target="_blank"&gt;here&lt;/A&gt; to
calculate recommended memory configuration against available resources.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Our POC cluster size:&lt;/STRONG&gt; 4 node cluster - 8 GB, 2
cores and 2 disks on each node&lt;/P&gt;&lt;P&gt;Please
refer below information and let me know if memory needs to be extended or do TEZ memory configuration needs to be changed to overcome "out of memory" issue?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Calculated memory
configuration uisng &lt;/STRONG&gt;&lt;STRONG&gt;yarn-utils.py&lt;/STRONG&gt;&lt;STRONG&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;$ python yarn-utils.py -c 2 -m 8 -d 2 -k True&lt;/P&gt;&lt;P style=""&gt; Using cores=2 memory=8GB disks=2 hbase=True &lt;/P&gt;&lt;P style=""&gt; Profile: cores=2 memory=5120MB reserved=3GB usableMem=5GB disks=2 &lt;/P&gt;&lt;P style=""&gt;Num Container=4 &lt;/P&gt;&lt;P style=""&gt; Container Ram=1024MB &lt;/P&gt;&lt;P style=""&gt;Used Ram=4GB &lt;/P&gt;&lt;P style=""&gt; Unused Ram=3GB &lt;/P&gt;&lt;P style=""&gt; yarn.scheduler.minimum-allocation-mb=1024 &lt;/P&gt;&lt;P style=""&gt;yarn.scheduler.maximum-allocation-mb=4096 &lt;/P&gt;&lt;P style=""&gt;yarn.nodemanager.resource.memory-mb=4096 &lt;/P&gt;&lt;P style=""&gt; mapreduce.map.memory.mb=1024 &lt;/P&gt;&lt;P style=""&gt; mapreduce.map.java.opts=-Xmx819m &lt;/P&gt;&lt;P style=""&gt; mapreduce.reduce.memory.mb=2048 &lt;/P&gt;&lt;P style=""&gt; mapreduce.reduce.java.opts=-Xmx1638m &lt;/P&gt;&lt;P style=""&gt; yarn.app.mapreduce.am.resource.mb=2048 &lt;/P&gt;&lt;P style=""&gt;yarn.app.mapreduce.am.command-opts=-Xmx1638m &lt;/P&gt;&lt;P style=""&gt; mapreduce.task.io.sort.mb=409&lt;/P&gt;&lt;P style=""&gt;&lt;STRONG&gt;Error Log:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;small&amp;gt; java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, vertexName=Map 1, vertexId=vertex_1542737559534_0026_1_00, diagnostics=[Task failed, taskId=task_1542737559534_0026_1_00_000000, diagnostics=[TaskAttempt 0 failed, info=[Error: Failure while running task:java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space
	at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:159)
	at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:139)
	at org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:347)
	at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable$1.run(TezTaskRunner.java:194)
	at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable$1.run(TezTaskRunner.java:185)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1869)
	at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable.callInternal(TezTaskRunner.java:185)
	at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable.callInternal(TezTaskRunner.java:181)
	at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOfRange(Arrays.java:3664)
	at java.lang.String.&amp;lt;init&amp;gt;(String.java:207)
	at java.lang.StringBuilder.toString(StringBuilder.java:407)
	at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:563)
	at org.apache.hadoop.hive.ql.exec.tez.MapRecordSource.processRow(MapRecordSource.java:88)
	at org.apache.hadoop.hive.ql.exec.tez.MapRecordSource.pushRecord(MapRecordSource.java:73)
	at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.run(MapRecordProcessor.java:325)
	at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:150)
	... 14 more
], TaskAttempt 1 failed, info=[Error: Failure while running task:java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space
	at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:159)
	at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:139)
	at org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:347)
	at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable$1.run(TezTaskRunner.java:194)
	at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable$1.run(TezTaskRunner.java:185)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1869)
	at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable.callInternal(TezTaskRunner.java:185)
	at org.apache.tez.runtime.task.TezTaskRunner$TaskRunnerCallable.callInternal(TezTaskRunner.java:181)
	at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOfRange(Arrays.java:3664)
	at java.lang.String.&amp;lt;init&amp;gt;(String.java:207)
	at java.lang.StringBuilder.toString(StringBuilder.java:407)
	at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:563)
	at org.apache.hadoop.hive.ql.exec.tez.MapRecordSource.processRow(MapRecordSource.java:88)
	at org.apache.hadoop.hive.ql.exec.tez.MapRecordSource.pushRecord(MapRecordSource.java:73)
	at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.run(MapRecordProcessor.java:325)
	at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:150)
	... 14 more&amp;lt;/small&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Jan 2019 03:15:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Out-of-Memory-issue-while-executing-simple-Hive-Query-java/m-p/241697#M203500</guid>
      <dc:creator>yrawekumarr</dc:creator>
      <dc:date>2019-01-09T03:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Out of Memory issue while executing simple Hive Query: java.lang.OutOfMemoryError: Java heap space</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Out-of-Memory-issue-while-executing-simple-Hive-Query-java/m-p/241698#M203501</link>
      <description>&lt;P&gt;This issue is resolved by reducing container size (increase memory for paramers - yarn.scheduler.minimum-allocation-mb, and tez.task.resource.memory.mb)&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 12:06:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Out-of-Memory-issue-while-executing-simple-Hive-Query-java/m-p/241698#M203501</guid>
      <dc:creator>yrawekumarr</dc:creator>
      <dc:date>2019-01-11T12:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Out of Memory issue while executing simple Hive Query: java.lang.OutOfMemoryError: Java heap space</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Out-of-Memory-issue-while-executing-simple-Hive-Query-java/m-p/334436#M231763</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could you pleases tell me how to reducing container size. But, I executed query successfully but sometimes it got fails. please suggest it is very urgent issue going on.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 10:48:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Out-of-Memory-issue-while-executing-simple-Hive-Query-java/m-p/334436#M231763</guid>
      <dc:creator>lav</dc:creator>
      <dc:date>2022-01-24T10:48:25Z</dc:date>
    </item>
  </channel>
</rss>

