如何在Hadoop中检查Map Task的内存占用量 [英] How to check memory footprint of Map Task in Hadoop

查看:341
本文介绍了如何在Hadoop中检查Map Task的内存占用量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以通过设置JVM参数来控制映射(或减少)任务的最大内存.但是我想知道是否有办法查看任务的当前内存使用情况?

I know I can control the max memory for a map (or reduce) task by setting JVM parameters. But I am wondering if there is a way to see current memory usage of a task?

推荐答案

启用远程HPROF分析. HPROF是JDK随附的性能分析工具,尽管基本,但可以提供有关程序的CPU和堆使用情况的有价值的信息. 要使用它,您可以在您的代码中尝试使用它:

enable remote HPROF profiling. HPROF is a profiling tool that comes with the JDK that, although basic, can give valuable information about a program’s CPU and heap usage. To use it, you can try this in your code:

conf.setBoolean("mapred.task.profile", true);
conf.set("mapred.task.profile.params", "-agentlib:hprof=cpu=samples," +
    "heap=sites,depth=6,force=n,thread=y,verbose=n,file=%s");
conf.set("mapred.task.profile.maps", "0-2");
conf.set("mapred.task.profile.reduces", ""); // no reduces

有关更多详细信息,请参见"Hadoop Definitve指南"的第5章->调整作业"->分析任务".

See "Hadoop The Definitve Guide", Chapter 5 -> "Tuning a Job" -> "Profiling Tasks" for more details.

这篇关于如何在Hadoop中检查Map Task的内存占用量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆