On a hadoop clusters that I am using, but do not have admin rights to, I see that the hadoop daemons for JobTracker, TaskTracker and DataNode are launched with the -Xmx options specified twice. Something like
/usr/java/default/bin/java -Dproc_datanode -Xmx1000m ... -Xmx128m ...
Now, in this case which option takes precedence? Is it the max of the two or the one that comes first or last?
This might not be specific to hadoop, just encountered it in this context so mentioning it.
As suggested by @fge I tested this with a standalone java program, with the following main method
public static void main(String[] args){
long mem = Runtime.getRuntime().maxMemory();
System.out.println("Max mem="+mem/(1024*1024) + "m");
}
and launched it with multiple -Xmx options, it seems to be picking up the last one. E.g.
java -Xmx100m -Xmx20m -Xmx400m
The program output is
Max mem=395m
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With