The app.getMaximumResourceCapability doesn't give you the resources of the entire cluster it gives you the maximum for a single resource (a resource is basically one container) request.  It returns whatever is set in the config yarn.scheduler.maximum-allocation-mb	(see http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/ClusterSetup.html).  Perhaps you had a very large value for this.  You'll see there is also a minimum which corresponds to yarn.scheduler.minimum-allocation-mb.

The only way I saw to get the resource of the entire cluster would be to iterate through the entire nodes list, which could get expensive on a large cluster so I left it off for now. I'll see if I can come up with better way but figured it could be done separately.