ItGo.me - 专注IT技术分享

首页 > Exception > java.lang.OutOfMemoryError: Java heap space

java.lang.OutOfMemoryError: Java heap space

时间:2016-07-24来源:网友分享 点击:
 FATAL org.apache.hadoop.mapred.Child: Error running child : java.lang.OutOfMemoryError: Java heap space
	at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
	at java.nio.ByteBuffer.allocate(ByteBuffer.java:331)
	at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:777)
	at org.apache.hadoop.io.Text.encode(Text.java:388)
	at org.apache.hadoop.io.Text.set(Text.java:178)
	....
	at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:177)
	at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
	at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:418)
	at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:415)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
	at org.apache.hadoop.mapred.Child.main(Child.java:249)


在编写mapreduce程序时,经常会出现程序卡住,最后报OutOfMemoryError: Java heap space的错误。
  是因为mapreduce的mapper,reducer的默认对内存大小是200m,可以通过
conf.set("mapreduce.admin.map.child.java.opts", "-Xmx512m");或者
conf.set("mapred.map.child.java.opts", "-Xmx512m");设置mapper阶段的堆内存大小
 conf.set("mapreduce.admin.reduce.child.java.opts", "-Xmx512m");或者
conf.set("mapred.reduce.child.java.opts", "-Xmx512m");设置reducer阶段的堆内存大小

Make sure you're using Spring 3.2.5 or better spring-data-solr解决

Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: AnnotationConfigUtils.processCommonDefinitionAnnotations(…) is not public! Make sure you're using Spring 3.2.5 or better...

java.lang.NoSuchMethodError: org.junit.runner.Request.classWithoutSuiteMethod解决方法

java.lang.NoSuchMethodError: org.junit.runner.Request.classWithoutSuiteMethod(Ljava/lang/Class;)Lorg/junit/runner/Request; 原因:这是junit4版本存在的bug; 解决方法:下载junit4.4进行替换就可以了。...

syntax error: Bad for loop variable解决方法

Syntax error: Bad for loop variable 解决办法:sudo dpkg-reconfigure dash 在选择项中选No ...

FATAL org.apache.hadoop.mapred.Child: Error running child : java.lang.OutOfMemoryError: Java heap space
------分隔线----------------------------