在做大数据分析的时候,使用到了zeppelin可视化,但是在运行的时候总是要出现Java heap space的错误。另外我使用hive 的beeline连接hive运行sql出现同样的内存溢出错误。
我在hive里设置了
set io.sort.mb=10;
可是还是有些数据分析可以运行,有些还会报错。
后来去hive的环境配置文件hive-env.sh里面(第40行)配置heap大小,这里我配置了2G,重新运行无报错。
# The heap size of the jvm stared by hive shell script can be controlled via:
#
export HADOOP_HEAPSIZE=2048
#
# Larger heap size may be required when running queries over large number of files or partitions.
# By default hive shell scripts use a heap size of 256 (MB). Larger heap size would also be
# appropriate for hive server.
通过使用hive shell脚本可以控制jvm的堆大小。
在大量文件或分区上运行查询时,可能需要更大的堆大小。
默认情况下,配置单元外壳脚本使用的堆大小为256(MB)。 较大的堆大小也将是
适用于配置单元服务器。
参考资料:
[1] 大壮vip. CSDN. hive报错Java heap space
[2] 撸依天. CSDN. 跑hive有时成功有时失败!org.apache.hadoop.hive.ql.exec.mr.MapRedTask
[3] jxzxm1_2. CSDN. java.lang.OutOfMemoryError: Java heap space错误及处理办法(收集整理、转)
[4] zhuguorong11. CSDN. hive中出现rg.apache.hadoop.hive.ql.exec.mr.MapRedTask错误