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=47660,containerID=container_1453101066555_4130018_01_000067] 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. Killing container.

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

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

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

posted @ 2016-05-03 11:04  李秋  阅读(1478)  评论(0编辑  收藏  举报