How to check memory footprint of Map Task in Hadoop

亡梦爱人 提交于 2019-12-10 23:50:03

问题


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?


回答1:


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

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



来源:https://stackoverflow.com/questions/12314762/how-to-check-memory-footprint-of-map-task-in-hadoop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!