Halting due to Out Of Memory Error...Exit code 255 - hive - tez - java heap - GC

Hello All,
Can some one please help me fix this OOM error||heap issue , while running query from hive
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "client DomainSocketWatcher"
-----------
Map1 - stays in initializing state and not moving to running state with OOM error
ERROR:
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 exitCode: 255
Failing this attempt.Diagnostics: [2021-09-07 09:49:05.213]Exception from container-launch.
Container exited with a non-zero exit code 255. Error file: prelaunch.err.
Exit code: 255
--------------------------------------------------------------------------
java.sql.SQLExceptionPyRaisable Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/jaydebeapi/__init__.py in execute(self, operation, parameters)
500 try:
--> 501 is_rs = self._prep.execute()
502 except:
--------------------------
--------
[Eden: 0.0B(163.0M)->0.0B(163.0M) Survivors: 0.0B->0.0B Heap: 3275.3M(3276.0M)->3275.3M(3276.0M)]
[Times: user=0.01 sys=0.00, real=0.00 secs]
326.881: [Full GC (Allocation Failure)
--------------------
exec /bin/bash -c "$JAVA_HOME/bin/java -Xmx3276m -Djava.io.tmpdir=$PWD/tmp -server
-------
config
-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseG1GC -XX:+ResizeTLAB{{heap_dump_opts}}
Hive - used for querying
Tez - application type
Yarn - scheduler

