我试图在我的Mac上构建完整的Hadoop源代码。当我尝试构建时,我经常遇到错误:“Java.lang.OutOfMemoryError:Java堆空间”。我尝试使用命令export maven_opts=“-xms256m-xmx1024m”和export maven_opts=“-xmx2g-xx:maxpermsize=512m-xx:reservedcodecachesize=512m”设置maven选项。但这些解决方案都没有帮到我。我有一个4GB DDR3内存。2.3GHz英特尔酷睿i5处理器。请给我提供正确的方向。日志:
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Hadoop HDFS 2.4.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ hadoop-hdfs ---
[INFO] Deleting /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (create-testdirs) @ hadoop-hdfs ---
[INFO] Executing tasks
main:
[mkdir] Created dir: /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/test-dir
[mkdir] Created dir: /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/test/data
[INFO] Executed tasks
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (create-jsp-generated-sources-directory) @ hadoop-hdfs ---
[INFO] Executing tasks
main:
[mkdir] Created dir: /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/generated-sources/java
[INFO] Executed tasks
[INFO]
[INFO] --- jspc-maven-plugin:2.0-alpha-3:compile (hdfs) @ hadoop-hdfs ---
[WARNING] Compiled JSPs will not be added to the project and web.xml will not be modified, either because includeInProject is set to false or because the project's packaging is not 'war'.
Created dir: /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/classes
[INFO] Compiling 8 JSP source files to /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/generated-sources/java
[INFO] Built File: /block_info_xml.jsp
[INFO] Built File: /corrupt_files.jsp
[INFO] Built File: /corrupt_replicas_xml.jsp
[INFO] Built File: /decommission.jsp
[INFO] Built File: /dfsclusterhealth.jsp
[INFO] Built File: /dfshealth.jsp
[INFO] Built File: /dfsnodelist.jsp
[INFO] Built File: /nn_browsedfscontent.jsp
WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html for an explanation.
[INFO] Compiled completed in 0:00:00.579
[INFO]
[INFO] --- jspc-maven-plugin:2.0-alpha-3:compile (secondary) @ hadoop-hdfs ---
[WARNING] Compiled JSPs will not be added to the project and web.xml will not be modified, either because includeInProject is set to false or because the project's packaging is not 'war'.
[INFO] Compiling 1 JSP source file to /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/generated-sources/java
[INFO] Built File: /status.jsp
WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html for an explanation.
[INFO] Compiled completed in 0:00:00.041
[INFO]
[INFO] --- jspc-maven-plugin:2.0-alpha-3:compile (journal) @ hadoop-hdfs ---
[WARNING] Compiled JSPs will not be added to the project and web.xml will not be modified, either because includeInProject is set to false or because the project's packaging is not 'war'.
[INFO] Compiling 1 JSP source file to /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/generated-sources/java
[INFO] Built File: /journalstatus.jsp
WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html for an explanation.
[INFO] Compiled completed in 0:00:00.041
[INFO]
[INFO] --- jspc-maven-plugin:2.0-alpha-3:compile (datanode) @ hadoop-hdfs ---
[WARNING] Compiled JSPs will not be added to the project and web.xml will not be modified, either because includeInProject is set to false or because the project's packaging is not 'war'.
[INFO] Compiling 4 JSP source files to /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/generated-sources/java
[INFO] Built File: /browseBlock.jsp
[INFO] Built File: /browseDirectory.jsp
[INFO] Built File: /dataNodeHome.jsp
[INFO] Built File: /tail.jsp
WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html for an explanation.
[INFO] Compiled completed in 0:00:00.073
[INFO]
[INFO] --- build-helper-maven-plugin:1.5:add-source (add-jsp-generated-sources-directory) @ hadoop-hdfs ---
[INFO] Source directory: /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/generated-sources/java added.
[INFO]
[INFO] --- hadoop-maven-plugins:2.4.0:protoc (compile-protoc) @ hadoop-hdfs ---
[WARNING] [protoc, --version] failed with error code 1
[INFO]
[INFO] --- hadoop-maven-plugins:2.4.0:protoc (compile-protoc-datanode) @ hadoop-hdfs ---
[WARNING] [protoc, --version] failed with error code 1
[INFO]
[INFO] --- hadoop-maven-plugins:2.4.0:protoc (compile-protoc-namenode) @ hadoop-hdfs ---
[WARNING] [protoc, --version] failed with error code 1
[INFO]
[INFO] --- hadoop-maven-plugins:2.4.0:protoc (compile-protoc-qjournal) @ hadoop-hdfs ---
[WARNING] [protoc, --version] failed with error code 1
[INFO]
[INFO] --- maven-resources-plugin:2.2:resources (default-resources) @ hadoop-hdfs ---
[INFO] Using default encoding to copy filtered resources.
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ hadoop-hdfs ---
[INFO] Compiling 587 source files to /Users/harshavyaspalli/Sachin/hadoop/hadoop-2.4.0-src/hadoop-hdfs-project/hadoop-hdfs/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space
at com.sun.tools.javac.util.Position$LineMapImpl.build(Position.java:139)
at com.sun.tools.javac.util.Position.makeLineMap(Position.java:63)
at com.sun.tools.javac.parser.Scanner.getLineMap(Scanner.java:1113)
at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:512)
at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:550)
at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:804)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.sun.tools.javac.main.Main.compile(Main.java:279)
at com.sun.tools.javac.main.Main.compile(Main.java:270)
at com.sun.tools.javac.Main.compile(Main.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess0(JavacCompiler.java:551)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:526)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:167)
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:678)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Hadoop Main ................................ SUCCESS [ 3.836 s]
[INFO] Apache Hadoop Project POM ......................... SUCCESS [ 1.634 s]
[INFO] Apache Hadoop Annotations ......................... SUCCESS [ 3.661 s]
[INFO] Apache Hadoop Assemblies .......................... SUCCESS [ 0.441 s]
[INFO] Apache Hadoop Project Dist POM .................... SUCCESS [ 2.310 s]
[INFO] Apache Hadoop Maven Plugins ....................... SUCCESS [ 4.806 s]
[INFO] Apache Hadoop MiniKDC ............................. SUCCESS [ 4.093 s]
[INFO] Apache Hadoop Auth ................................ SUCCESS [ 4.638 s]
[INFO] Apache Hadoop Auth Examples ....................... SUCCESS [ 2.795 s]
[INFO] Apache Hadoop Common .............................. SUCCESS [01:38 min]
[INFO] Apache Hadoop NFS ................................. SUCCESS [ 11.257 s]
[INFO] Apache Hadoop Common Project ...................... SUCCESS [ 0.051 s]
[INFO] Apache Hadoop HDFS ................................ FAILURE [ 15.643 s]
[INFO] Apache Hadoop HttpFS .............................. SKIPPED
[INFO] Apache Hadoop HDFS BookKeeper Journal ............. SKIPPED
谢谢和问候。
这个错误是由maven编译器插件抛出的,编辑您正在构建的pom文件,属性maven-compiler-plugin add below configuration下
<configuration>
<verbose>true</verbose>
<fork>true</fork>
</configuration>
这将清除堆空间错误。
问题内容: 我最近在具有24个CPU和32GB RAM的服务器上使用了带有Ipython的PySpark。它仅在一台机器上运行。在我的过程中,我想收集以下代码中给出的大量数据: 当我做 它给我outOfMemory错误。。另外,此错误发生后,我无法在Spark上执行任何操作,因为它失去了与Java的连接。它给。 看起来堆空间很小。如何设置更大的限制? 编辑 : 我在运行之前尝试过的事情: 我根据此
问题内容: 我在执行多线程程序时遇到以下错误 上面的错误发生在其中一个线程中。 据我所知,堆空间仅由实例变量占用。如果这是正确的,那么为什么在运行一段时间后会出现此错误,因为在创建对象时分配了实例变量的空间。 有什么办法可以增加堆空间? 我应该对程序进行哪些更改,以使其占用更少的堆空间? 问题答案: 如果要增加堆空间,可以 -在命令行上使用。默认情况下,这些值基于JRE版本和系统配置。你可以在Ja
我面临一些关于内存问题的问题,但我无法解决它。非常感谢您的帮助。我不熟悉Spark和pyspark功能,试图读取大约5GB大小的大型JSON文件,并使用 每次运行上述语句时,都会出现以下错误: 我需要以RDD的形式获取JSON数据,然后使用SQLSpark进行操作和分析。但是我在第一步(读取JSON)本身就出错了。我知道要读取如此大的文件,需要对Spark会话的配置进行必要的更改。我遵循了Apac
我想从网页上选定的文本中提取名词,并在文本显示时突出显示它们。所以我使用OpenNLP库来解析和获取名词列表。它在java类中运行良好,没有内存问题,尽管在显示输出之前花费了6-7秒,但当我在jsp页面中运行代码时,我得到了以下错误: 根本原因 我读到的一些解决方案建议通过这样做来增加apache tomcat的堆内存大小: 所以我将其设置为-Xmx2g,但仍然会产生相同的错误。我认为我不需要修改
我最近一直在我的服务器上使用PySpark和Ipython,服务器上有24个CPU和32GB RAM。它只在一台机器上运行。在我的过程中,我想收集大量的数据,如下代码所示: 当我做的时候 它给了我outOfMemory错误。。此外,我不能在此错误后对Spark执行任何操作,因为它失去了与Java的连接。它给出了。 看起来堆空间很小。我怎么才能把它设置到更大的限度呢? 编辑: 运行前尝试的内容: 我
我使用javaml训练分类器。现在,我的数据中的实例包含如下格式的向量 1 0:5 1:9 24:2 ...... 所以当我从文件中读取这些时,我使用string.split.然后将值放入稀疏实例中,然后将其添加到分类器中。 然而,我得到了一个堆空间内存错误。我读过关于字符串的文章。split()导致内存泄漏,因此我使用了新的String来避免内存泄漏。然而,我仍然面临堆空间问题 代码如下所示 /
问题内容: Java内存空间(Perm空间,Space Stack,堆空间)之间有什么区别? JVM什么时候使用一个或另一个? 如果我使用Scala / Groovy / etc等,会有区别吗? 问题答案: 只是 堆空间:所有活动对象都分配在这里。 堆栈空间:在方法调用或变量实例化中存储对对象的引用以获取变量。 烫发空间:存储已加载的类信息 例如: 执行完上述行之后,内存状态将是这样。 堆:存储“
问题内容: 首先,Perm空间和Heap空间之间有什么区别(JVM选择如何以及如何选择使用每个内存空间)? 其次,但最重要的是,对于标准MVC类型的Java应用程序,建议采用哪种比率? 问题答案: 该 堆 存储所有的Java程序创建的对象。堆的内容由垃圾收集器监控,当您停止使用对象时(即,当不再有对该对象的引用时),垃圾收集器会从堆中释放内存。 这与 堆栈 相反, 堆栈 存储原始类型(如ints和