Will hadoop cluster automatically release jvm memory after performing tasks?
1. Memory hadoop uniformly allocates memory for each daemon (NameNode, secondary NameNode, Job Tracker, DataNode, Tasktracker). The parameter is Hadoop _ heap, and the default value is 1000M. In most cases, the value of this uniform setting may not be appropriate. For example, NameNode, 1000M memory can only store references to data blocks of millions of files. If you want to set the memory of namenode separately, you can set it through HADOOP_NAMENODE_OPTS. Similarly, you can set the memory of SECONDARYNAMENODE through HADOOP_secondarynamenode_OPTS to make it consistent with namenode. Of course, there are HADOOP_DATANODE_OPTS, HADOOP_BALANCER_OPTS and HADOOP_JOBTRACKER_OPTS variables for you to use. In addition, tasktracker starts an independent sub-JVM to run the map and reduce tasks, and the amount of memory allocated to each sub-JVM is controlled by the mapred.child.java.opts attribute (mapred-site.xml), and the default value is 200M. 2. Maximum number of map tasks The maximum number of map tasks that tasktracker can run at the same time is controlled by the mapred.tasktracker.map.tasks.maximum attribute (mapred-site.xml), and the default value is 2. 3. The maximum number of reduce tasks The maximum number of reduce tasks that tasktracker can run at the same time is controlled by Mapred. Tasktracker.reduce.tasks.maximum (mapred-site.xml), the default value is 2. 4. Small summary: Calculate the memory usage of nodes. By default, the master node running namenode, secondarynamenode and jobtracker at the same time uses 1000M memory, so a total of 3000M is used. By default, the slave node runs the following daemon: 1 datanode: by default, it occupies 1000M memory. 1 tasktracker: 1000M memory is occupied by default. Up to 2 map tasks: 2*200M=400M. Up to 2 reduce tasks: 2*200M=400M. In other words, by default, the slave node needs to use 2800M memory.