is running beyond physical memory limits. Current usage: 2.0 GB of 2 GB physical memory used; 2.6 GB of 40 GB virtual memory used

时间:2023-03-08 18:58:13
is running beyond physical memory limits. Current usage: 2.0 GB of 2 GB physical memory used; 2.6 GB of 40 GB virtual memory used

昨天使用hadoop跑五一的数据,发现报错:

Container [pid=,containerID=container_1453101066555_4130018_01_000067] is running beyond physical memory limits. Current usage: 2.0 GB of  GB physical memory used; 2.6 GB of  GB virtual memory used. Killing container.

发现是内存溢出了,遇到这种问题首先要判断是map阶段溢出还是reduce阶段溢出,然后分别设置其内存的大小,比如:

在运行hive sql前加上 :  (map)
set mapreduce.map.memory.mb=2048
或者 (reduce)
set mapreduce.reduce.memory.mb=2048

因为默认值都是:1024M,也就是一个G,如果不够就会溢出!