Integer overflow when calculating capacity

I my example, memClass would typically be 192, percentage 25.
This SHOULD evaluate to 50331648, but due to integer overflow we
would end up with 7381975 instead.

Though about adding a test for this, but that would require some refactoring and make this pull request much bigger.