简体   繁体   English

hadoop windows(工作正常)linux java堆空间

[英]hadoop windows (work ok) linux java heap space

Here is my problem: First of all I'm working with hadoop and a single node configuration I'm developing an application and I made just one map function, in this map function I call like 10 functions, the application reads from a csv file and process a certain column, I already made the jar file and everything so when I run this app with a csv with 4000 rows on windows (windows 7) (using cygwin) on a 4 GB RAM machine, the application works fine, but when I run it on linux- ubuntu on a 2 GB RAM machine, it process some rows but then it throws a "Java heap space" error, or sometimes the thread is killed.这是我的问题:首先,我正在使用 hadoop 和单节点配置,我正在开发一个应用程序,我只做了一个映射函数,在这个映射函数中,我调用了 10 个函数,应用程序从 csv 文件中读取并处理某个列,我已经制作了 jar 文件和所有内容,因此当我在 4 GB RAM 机器上的 Windows(Windows 7)(使用 cygwin)上使用 4000 行的 csv 运行此应用程序时,该应用程序工作正常,但是当我在 linux-ubuntu 的 2 GB RAM 机器上运行它,它处理一些行,但随后抛出“Java 堆空间”错误,或者有时线程被终止。

For the linux: I already tried to change the hadoop export HEAP_SIZE and also the Xmx and Xms parameters on the app and it made some difference but not too much, the error stills happening...对于 linux:我已经尝试更改应用程序上的 hadoop 导出 HEAP_SIZE 以及 Xmx 和 Xms 参数,它产生了一些差异但不是太大,错误仍然发生......

Do you know why it s happening?你知道为什么会这样吗? its because the 4GB and 2GB of RAM difference between machines?是因为机器之间4GB和2GB的RAM差异吗?

One thing I ran into with a mapper is if you call/use functions/objects that start their own threads from within the map function, this can easily create enough threads to use all the heap space for that JVM.我在使用映射器时遇到的一件事是,如果您调用/使用从map函数内启动自己线程的函数/对象,这可以轻松创建足够的线程来使用该 JVM 的所有堆空间。 Each mapper will have the setup and cleanup function called once.每个映射器都会调用一次setupcleanup函数。 In my situation I was able to process and put into an ArrayList all my data, then do the additional processing I needed in the cleanup function.在我的情况下,我能够处理并将我的所有数据放入ArrayList ,然后在cleanup函数中进行我需要的额外处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM